diff options
author | jwestfall@surrealistic.net <jwestfall@surrealistic.net> | 2006-01-14 17:43:22 +0000 |
---|---|---|
committer | Benjamin Larsson <banan@ludd.ltu.se> | 2006-01-14 17:43:22 +0000 |
commit | dd1a74d25decd6eaa7c78a7062fa12edb043efaf (patch) | |
tree | 928ae0d991500b5fa6e070eaf2c49e43a2abbe8a /libavcodec/mpeg12.c | |
parent | 4bdd05e76fa8ba61805c168612e875c9b06947a2 (diff) | |
download | ffmpeg-dd1a74d25decd6eaa7c78a7062fa12edb043efaf.tar.gz |
Off by one fix to prevent possible segfault. Patch by jwestfall at surrealistic dot net.
Originally committed as revision 4857 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 514ff29318..c582ad7a0d 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2178,7 +2178,7 @@ static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end) const uint8_t *buf_ptr= *pbuf_ptr; buf_ptr++; //gurantees that -1 is within the array - buf_end -= 2; // gurantees that +2 is within the array + buf_end -= 3; // gurantees that +3 is within the array while (buf_ptr < buf_end) { if(*buf_ptr==0){ @@ -2192,7 +2192,7 @@ static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end) } buf_ptr += 2; } - buf_end += 2; //undo the hack above + buf_end += 3; //undo the hack above *pbuf_ptr = buf_end; return -1; |