mirror of https://git.ffmpeg.org/ffmpeg.git
fix potential buffer over-read
Originally committed as revision 10966 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
cc04af3481
commit
73039e0fb4
|
@ -121,7 +121,7 @@ static int mpegps_read_header(AVFormatContext *s,
|
||||||
s->ctx_flags |= AVFMTCTX_NOHEADER;
|
s->ctx_flags |= AVFMTCTX_NOHEADER;
|
||||||
|
|
||||||
get_buffer(&s->pb, buffer, sizeof(buffer));
|
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))
|
if (!memcmp(p, "Sofdec", 6))
|
||||||
m->sofdec = 1;
|
m->sofdec = 1;
|
||||||
url_fseek(&s->pb, -(offset_t)sizeof(buffer), SEEK_CUR);
|
url_fseek(&s->pb, -(offset_t)sizeof(buffer), SEEK_CUR);
|
||||||
|
|
Loading…
Reference in New Issue