Mercurial > libavcodec.hg
comparison h264.c @ 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 | 5a523aee7379 |
children | fb8cbb18b2b4 |
comparison
equal
deleted
inserted
replaced
4840:a743c46500d4 | 4841:861ff463ac61 |
---|---|
8057 *poutbuf = NULL; | 8057 *poutbuf = NULL; |
8058 *poutbuf_size = 0; | 8058 *poutbuf_size = 0; |
8059 return buf_size; | 8059 return buf_size; |
8060 } | 8060 } |
8061 | 8061 |
8062 if(next<0){ | 8062 if(next<0 && next != END_NOT_FOUND){ |
8063 assert(pc->last_index + next >= 0 ); | |
8063 find_frame_end(h, &pc->buffer[pc->last_index + next], -next); //update state | 8064 find_frame_end(h, &pc->buffer[pc->last_index + next], -next); //update state |
8064 } | 8065 } |
8065 } | 8066 } |
8066 | 8067 |
8067 *poutbuf = (uint8_t *)buf; | 8068 *poutbuf = (uint8_t *)buf; |