[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec h264.c,1.188,1.189

Loren Merritt CVS lorenm
Tue Feb 14 06:40:56 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv14720

Modified Files:
	h264.c 
Log Message:
fix some crashes on negative nalsize.



Index: h264.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -d -r1.188 -r1.189
--- h264.c	13 Feb 2006 18:13:13 -0000	1.188
+++ h264.c	14 Feb 2006 05:40:53 -0000	1.189
@@ -7507,6 +7507,15 @@
         nalsize = 0;
         for(i = 0; i < h->nal_length_size; i++)
             nalsize = (nalsize << 8) | buf[buf_index++];
+        if(nalsize <= 1){
+            if(nalsize == 1){
+                buf_index++;
+                continue;
+            }else{
+                av_log(h->s.avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
+                break;
+            }
+        }
       } else {
         // start code prefix search
         for(; buf_index + 3 < buf_size; buf_index++){





More information about the ffmpeg-cvslog mailing list