yop: check for missing extradata
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 28 May 2012 15:08:06 +0000 (17:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 28 May 2012 15:24:13 +0000 (17:24 +0200)
Fixes null ptr deref
Fixes Ticket1361

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/yop.c

index 05abb24..ac17297 100644 (file)
@@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
         return -1;
     }
 
+    if (!avctx->extradata) {
+        av_log(avctx, AV_LOG_ERROR, "extradata missing\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     avctx->pix_fmt = PIX_FMT_PAL8;
 
     avcodec_get_frame_defaults(&s->frame);