[FFmpeg-cvslog] avutil/imgutils: don't add offsets to NULL pointers

James Almer git at videolan.org
Wed May 12 23:21:25 EEST 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed May 12 00:33:45 2021 -0300| [fc99d595531c0742aae8fe088fc5aad519035f2a] | committer: James Almer

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

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc99d595531c0742aae8fe088fc5aad519035f2a
---

 libavutil/imgutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 53faad889a..6c32a71cc5 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -165,6 +165,9 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
         ret += sizes[i];
     }
 
+    if (!ptr)
+        return ret;
+
     data[0] = ptr;
     for (i = 1; i < 4 && sizes[i]; i++)
         data[i] = data[i - 1] + sizes[i - 1];



More information about the ffmpeg-cvslog mailing list