[FFmpeg-devel] [PATCH 2/3] h264: ff_h264_decode_extradata: check that buf is not NULL

Alexander Strasser eclipse7 at gmx.net
Sat Sep 24 20:37:29 CEST 2011


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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 6655749..1dea946 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -995,7 +995,7 @@ int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size)
 {
     AVCodecContext *avctx = h->s.avctx;
 
-    if(size <= 0)
+    if(!buf || size <= 0)
       return -1;
 
     if(buf[0] == 1){
-- 
1.7.5.4


More information about the ffmpeg-devel mailing list