Test extradata size before reading from extradata when decoding avui.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 28 May 2012 13:58:46 +0000 (15:58 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 28 May 2012 13:58:46 +0000 (15:58 +0200)
libavcodec/avuidec.c

index a1beb37..32fd819 100644 (file)
@@ -48,8 +48,8 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data,
     if (pic->data[0])
         avctx->release_buffer(avctx, pic);
 
-    if (!memcmp(&avctx->extradata[4], "APRGAPRG0001", 12) &&
-        avctx->extradata_size >= 24)
+    if (avctx->extradata_size >= 24 &&
+        !memcmp(&avctx->extradata[4], "APRGAPRG0001", 12))
         interlaced = avctx->extradata[19] != 1;
     if (avctx->height == 486) {
         skip = 10;