h264: fix null pointer dereference and assertion failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-03-11 22:11:51 +01:00
parent ee3c3dd523
commit 0fc01ae33c

View File

@ -1727,7 +1727,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
h->data_partitioning = h1->data_partitioning;
h->low_delay = h1->low_delay;
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
h->DPB[i].period_since_free ++;
unref_picture(h, &h->DPB[i]);
if (h1->DPB[i].f.data[0] &&
@ -1737,7 +1737,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1);
unref_picture(h, &h->cur_pic);
if ((ret = ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0)
if (h1->cur_pic.f.buf[0] && (ret = ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0)
return ret;
h->workaround_bugs = h1->workaround_bugs;