From e90a6846c2c006fbebd00e1f2789f4a86fafacef Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Thu, 12 Sep 2013 11:58:25 +0300 Subject: cavsdec: Make sure a sequence header has been decoded before decoding pictures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- libavcodec/cavsdec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/cavsdec.c') 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 -- cgit v1.2.3