[FFmpeg-cvslog] h264: fix null pointer dereference and assertion failure

Michael Niedermayer git at videolan.org
Tue Mar 12 03:31:00 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Mar 11 22:11:51 2013 +0100| [0fc01ae33c7712168aab0f98c5715b40da0b5f03] | committer: Michael Niedermayer

h264: fix null pointer dereference and assertion failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0fc01ae33c7712168aab0f98c5715b40da0b5f03
---

 libavcodec/h264.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 02b9a67..0f1c67a 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;



More information about the ffmpeg-cvslog mailing list