[FFmpeg-cvslog] avcodec/h264: fix code that blindly dereferences NULL DPB

Michael Niedermayer git at videolan.org
Tue Dec 10 23:59:35 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 10 23:41:50 2013 +0100| [d9339ab55373b12f078a3e3f1e294d8ff78652dd] | committer: Michael Niedermayer

avcodec/h264: fix code that blindly dereferences NULL DPB

Fixes mixed flushing and decoding NULL packets
Found-by: wm4

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

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

 libavcodec/h264.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 77a2657..0028227 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1851,7 +1851,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
 
     for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
         unref_picture(h, &h->DPB[i]);
-        if (h1->DPB[i].f.buf[0] &&
+        if (h1->DPB && h1->DPB[i].f.buf[0] &&
             (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
             return ret;
     }



More information about the ffmpeg-cvslog mailing list