[FFmpeg-cvslog] r16825 - trunk/libavformat/raw.c

benoit subversion
Tue Jan 27 19:00:41 CET 2009


Author: benoit
Date: Tue Jan 27 19:00:40 2009
New Revision: 16825

Log:
Check buffer is inside what is passed when probing for flac.

Modified:
   trunk/libavformat/raw.c

Modified: trunk/libavformat/raw.c
==============================================================================
--- trunk/libavformat/raw.c	Tue Jan 27 17:34:10 2009	(r16824)
+++ trunk/libavformat/raw.c	Tue Jan 27 19:00:40 2009	(r16825)
@@ -586,11 +586,12 @@ static int eac3_probe(AVProbeData *p)
 static int flac_probe(AVProbeData *p)
 {
     uint8_t *bufptr = p->buf;
+    uint8_t *end    = p->buf + p->buf_size;
 
     if(ff_id3v2_match(bufptr))
         bufptr += ff_id3v2_tag_len(bufptr);
 
-    if(memcmp(bufptr, "fLaC", 4)) return 0;
+    if(bufptr > end-4 || memcmp(bufptr, "fLaC", 4)) return 0;
     else                          return AVPROBE_SCORE_MAX / 2;
 }
 #endif




More information about the ffmpeg-cvslog mailing list