aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-11 22:11:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-12 03:23:56 +0100
commit0fc01ae33c7712168aab0f98c5715b40da0b5f03 (patch)
treef51674ed018abe4c845a2f3172c6bdb129ec2303
parentee3c3dd523623e0d9e69aa2ce268fef82b201458 (diff)
downloadffmpeg-0fc01ae33c7712168aab0f98c5715b40da0b5f03.tar.gz
h264: fix null pointer dereference and assertion failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c4
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;