]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/utils: Check that the video data[] arrays are NULL on the input to get_buffer...
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 26 Feb 2016 11:59:08 +0000 (12:59 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 27 Feb 2016 12:11:52 +0000 (13:11 +0100)
This should return an error to the decoder if the struct it tried to getbuffer is dirty

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/utils.c

index b5de8a10b1c6850fe65641e3d03d70dae003ee87..5791ffaef691872c5f5b43310fefd75317acc43d 100644 (file)
@@ -870,6 +870,11 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
             frame->height = FFMAX(avctx->height, AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres));
             override_dimensions = 0;
         }
+
+        if (frame->data[0] || frame->data[1] || frame->data[2] || frame->data[3]) {
+            av_log(avctx, AV_LOG_ERROR, "pic->data[*]!=NULL in get_buffer_internal\n");
+            return AVERROR(EINVAL);
+        }
     }
     ret = ff_decode_frame_props(avctx, frame);
     if (ret < 0)