changeset 2727:a21454bf80b8 libavformat

fix potential buffer over-read
author aurel
date Thu, 08 Nov 2007 20:53:06 +0000
parents 5dbc1dfc1300
children e00622d9d3c9
files mpeg.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);