cavsdec: Make sure a sequence header has been decoded before decoding pictures
authorMartin Storsjö <martin@martin.st>
Thu, 12 Sep 2013 08:58:25 +0000 (11:58 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 16 Sep 2013 08:04:52 +0000 (11:04 +0300)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/cavsdec.c

index c2c6772..e91ff6c 100644 (file)
@@ -931,6 +931,11 @@ static int decode_pic(AVSContext *h)
     int skip_count    = -1;
     enum cavs_mb mb_type;
 
+    if (!h->top_qp) {
+        av_log(h->avctx, AV_LOG_ERROR, "No sequence header decoded yet\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     av_frame_unref(h->cur.f);
 
     skip_bits(&h->gb, 16);//bbv_dwlay