[FFmpeg-devel] [PATCH 1/2] avcodec/utils: Check all data[] pointers in video_get_buffer() not just the first

Michael Niedermayer michael at niedermayer.cc
Fri Feb 26 12:59:07 CET 2016


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/utils.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index af21cdd..f8dee50 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -656,8 +656,8 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format);
     int i;
 
-    if (pic->data[0]) {
-        av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n");
+    if (pic->data[0] || pic->data[1] || pic->data[2] || pic->data[3]) {
+        av_log(s, AV_LOG_ERROR, "pic->data[*]!=NULL in avcodec_default_get_buffer\n");
         return -1;
     }
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list