aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-12 11:58:25 +0300
committerMartin Storsjö <martin@martin.st>2013-09-16 11:04:52 +0300
commite90a6846c2c006fbebd00e1f2789f4a86fafacef (patch)
tree5d32ed109530fc975cb0417a740fa900b99a9b31
parent5bbfe193a0a41bd2adb648c8c3f6901a575734a2 (diff)
downloadffmpeg-e90a6846c2c006fbebd00e1f2789f4a86fafacef.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>
-rw-r--r--libavcodec/cavsdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index c2c6772134..e91ff6c877 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