summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2007-04-11 14:04:47 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-04-11 14:04:47 +0000
commit3b77e48f0a4b6d660cd7eb14cd56f93fcb426ae2 (patch)
treeb1f222f25c420a2b1e3ce5ecdd1e026c16173810 /libavcodec/h264.c
parentd64b88d440bcd2121bce8e7b15505396f0f1d118 (diff)
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 Originally committed as revision 8714 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4fcdb75bce..fd70b0f231 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -8059,7 +8059,8 @@ static int h264_parse(AVCodecParserContext *s,
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
}
}