Module: libav
Branch: master
Commit: e90a6846c2c006fbebd00e1f2789f4a86fafacef

Author:    Martin Storsjö <[email protected]>
Committer: Martin Storsjö <[email protected]>
Date:      Thu Sep 12 11:58:25 2013 +0300

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

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
Signed-off-by: Martin Storsjö <[email protected]>

---

 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

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to