changeset 4841:861ff463ac61 libavcodec

add a check before find_frame_end call Patch by Limin Wang % lance P lmwang A gmail P com % Original thread: date: 04/09/2007 03:54 PM subject: [Ffmpeg-devel] [PATCH] fix segment fault in h264_parse if buf_size is zero
author benoit
date Wed, 11 Apr 2007 14:04:47 +0000
parents a743c46500d4
children c3b0eb402862
files h264.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Wed Apr 11 13:10:13 2007 +0000
+++ b/h264.c	Wed Apr 11 14:04:47 2007 +0000
@@ -8059,7 +8059,8 @@
             return buf_size;
         }
 
-        if(next<0){
+        if(next<0 && next != END_NOT_FOUND){
+            assert(pc->last_index + next >= 0 );
             find_frame_end(h, &pc->buffer[pc->last_index + next], -next); //update state
         }
     }