summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-11-08 20:53:06 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-11-08 20:53:06 +0000
commit73039e0fb4e5fbd13602c866ec98e097a777f1f5 (patch)
tree7991f28a4b490411a829f3e67e0d69f5249a92b3 /libavformat/mpeg.c
parentcc04af3481438e74278fff4532a0956363155708 (diff)
fix potential buffer over-read
Originally committed as revision 10966 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 34168ba786..076cc8fea1 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -121,7 +121,7 @@ static int mpegps_read_header(AVFormatContext *s,
s->ctx_flags |= AVFMTCTX_NOHEADER;
get_buffer(&s->pb, buffer, sizeof(buffer));
- if ((p=memchr(buffer, 'S', sizeof(buffer))))
+ if ((p=memchr(buffer, 'S', sizeof(buffer)-5)))
if (!memcmp(p, "Sofdec", 6))
m->sofdec = 1;
url_fseek(&s->pb, -(offset_t)sizeof(buffer), SEEK_CUR);