diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-12 01:11:51 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-12 06:23:56 +0400 |
commit | 0fc01ae33c7712168aab0f98c5715b40da0b5f03 (patch) | |
tree | f51674ed018abe4c845a2f3172c6bdb129ec2303 /libavcodec/h264.c | |
parent | ee3c3dd523623e0d9e69aa2ce268fef82b201458 (diff) |
h264: fix null pointer dereference and assertion failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 02b9a67739..0f1c67a85a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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; |