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

Martin Storsjö git at videolan.org
Tue Oct 8 00:55:48 CEST 2013


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Thu Sep 12 11:58:25 2013 +0300| [9f883e75e66a0cc0ddde78dabf52a8c78a25e9bb] | committer: Luca Barbato

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>
(cherry picked from commit e90a6846c2c006fbebd00e1f2789f4a86fafacef)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavcodec/cavsdec.c

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

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

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index cef6b95..7cfb2ca 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;
+    }
+
     skip_bits(&h->gb, 16);//bbv_dwlay
     if (h->stc == PIC_PB_START_CODE) {
         h->cur.f->pict_type = get_bits(&h->gb, 2) + AV_PICTURE_TYPE_I;



More information about the ffmpeg-cvslog mailing list