# HG changeset patch # User aurel # Date 1194555186 0 # Node ID a21454bf80b8c46693206a108e1bbd3c26ce4447 # Parent 5dbc1dfc1300de650e5dc2be7a99a0a99898102f fix potential buffer over-read diff -r 5dbc1dfc1300 -r a21454bf80b8 mpeg.c --- a/mpeg.c Thu Nov 08 20:50:45 2007 +0000 +++ b/mpeg.c Thu Nov 08 20:53:06 2007 +0000 @@ -121,7 +121,7 @@ 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);