avcodec/utils: Check all data[] pointers in video_get_buffer() not just the first
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 26 Feb 2016 11:59:07 +0000 (12:59 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 27 Feb 2016 12:11:52 +0000 (13:11 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/utils.c

index 0da82ad..b5de8a1 100644 (file)
@@ -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;
     }