From 9faae05ddf27369838fbd500468484af31f1219c Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 26 Jul 2020 21:50:25 -0300 Subject: [PATCH] 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 --- libavutil/imgutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index e592f7976a..bd1333170a 100644 --- a/libavutil/imgutils.c +++ b/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]; 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];