aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-12 11:58:25 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-01-07 09:43:56 +0100
commit7f80928c0e7a74dff58d6c9b0172e34619844d01 (patch)
tree08b26c6b5e0436404e96be39df3779063ad21260
parentb9e90b36cd3b87298b524330640818411b5ff45e (diff)
downloadffmpeg-7f80928c0e7a74dff58d6c9b0172e34619844d01.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 1dd237a755..5582fd42d3 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -467,6 +467,11 @@ static int decode_pic(AVSContext *h) {
int skip_count = -1;
enum cavs_mb mb_type;
+ if (!h->top_qp) {
+ av_log(h, AV_LOG_ERROR, "No sequence header decoded yet\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (!s->context_initialized) {
s->avctx->idct_algo = FF_IDCT_CAVS;
if (MPV_common_init(s) < 0)