Merge commit 'e90a6846c2c006fbebd00e1f2789f4a86fafacef'

* commit 'e90a6846c2c006fbebd00e1f2789f4a86fafacef':
  cavsdec: Make sure a sequence header has been decoded before decoding pictures

See: ec0965be36
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-16 12:44:02 +02:00
commit 18e0dd05df
1 changed files with 5 additions and 2 deletions

View File

@ -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))