[FFmpeg-cvslog] cavsdec: Make sure a sequence header has been decoded before decoding pictures

Martin Storsjö git at videolan.org
Mon Sep 16 13:11:42 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Sep 12 11:58:25 2013 +0300| [e90a6846c2c006fbebd00e1f2789f4a86fafacef] | committer: Martin Storsjö

cavsdec: Make sure a sequence header has been decoded before decoding pictures

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e90a6846c2c006fbebd00e1f2789f4a86fafacef
---

 libavcodec/cavsdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index c2c6772..e91ff6c 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -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



More information about the ffmpeg-cvslog mailing list