aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-12 11:58:25 +0300
committerLuca Barbato <lu_zero@gentoo.org>2013-10-04 03:26:24 +0200
commit9f883e75e66a0cc0ddde78dabf52a8c78a25e9bb (patch)
tree76ee73e48eb3fe26d8ccbefbc27fb6b8bb2e6eb4
parente47543eda585a6a3655d29bca17ab218f85f6646 (diff)
downloadffmpeg-9f883e75e66a0cc0ddde78dabf52a8c78a25e9bb.tar.gz
cavsdec: Make sure a sequence header has been decoded before decoding pictures
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit e90a6846c2c006fbebd00e1f2789f4a86fafacef) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavcodec/cavsdec.c
-rw-r--r--libavcodec/cavsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index cef6b953a5..7cfb2ca21b 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;