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>
pull/345/head
James Almer 5 years ago
parent 5ce47d0aad
commit 9faae05ddf
  1. 4
      libavutil/imgutils.c

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

Loading…
Cancel
Save