Commit 0fc01ae3 authored by Michael Niedermayer's avatar Michael Niedermayer

h264: fix null pointer dereference and assertion failure

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ee3c3dd5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment