diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-16 12:44:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-16 13:04:00 +0200 |
commit | 18e0dd05df136ce049b9827367bbf680a2c12d89 (patch) | |
tree | 9944ff3d0076e2dfa07a3b8dd84ac2c2ee7d55c3 | |
parent | ff0a382758b89180605554755c4bb3f29ea7e8f8 (diff) | |
parent | e90a6846c2c006fbebd00e1f2789f4a86fafacef (diff) | |
download | ffmpeg-18e0dd05df136ce049b9827367bbf680a2c12d89.tar.gz |
Merge commit 'e90a6846c2c006fbebd00e1f2789f4a86fafacef'
* commit 'e90a6846c2c006fbebd00e1f2789f4a86fafacef':
cavsdec: Make sure a sequence header has been decoded before decoding pictures
See: ec0965be36b55624a03d20c3b24e6a7aa61d6cd2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cavsdec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index ec4a819eab..5e7c0ce924 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -948,6 +948,11 @@ static int decode_pic(AVSContext *h) int ret; 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 @@ -1178,8 +1183,6 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, *got_frame = 0; if (!h->got_keyframe) break; - if(!h->top_qp) - break; init_get_bits(&h->gb, buf_ptr, input_size); h->stc = stc; if (decode_pic(h)) |