avutil/imgutils: always zero data pointers in av_image_fill_pointers()

This restores the relevant behavior of the function as it was before
3a8e927176.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2020-07-26 21:50:25 -03:00
parent 5ce47d0aad
commit 9faae05ddf
1 changed files with 2 additions and 2 deletions

View File

@ -150,6 +150,8 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
ptrdiff_t linesizes1[4];
size_t sizes[4];
memset(data , 0, sizeof(data[0])*4);
for (i = 0; i < 4; i++)
linesizes1[i] = linesizes[i];
@ -164,8 +166,6 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
ret += sizes[i];
}
memset(data , 0, sizeof(data[0])*4);
data[0] = ptr;
for (i = 1; i < 4 && sizes[i]; i++)
data[i] = data[i - 1] + sizes[i - 1];