1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avutil/imgutils: don't add offsets to NULL pointers

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2021-05-12 00:33:45 -03:00
parent 6a9a4f34bd
commit fc99d59553

View File

@ -165,6 +165,9 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
ret += sizes[i]; ret += sizes[i];
} }
if (!ptr)
return ret;
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];