]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/flacdec.c
movenc: Keep track of the allocated size for the cluster array
[ffmpeg] / libavformat / flacdec.c
index 7aaec9eb26eda7c02cda187488806e023c547648..9737095bbb199e6d00877842f98e9f79774c4fb5 100644 (file)
@@ -279,11 +279,9 @@ static int flac_read_header(AVFormatContext *s)
 
 static int flac_probe(AVProbeData *p)
 {
-    uint8_t *bufptr = p->buf;
-    uint8_t *end    = p->buf + p->buf_size;
-
-    if(bufptr > end-4 || memcmp(bufptr, "fLaC", 4)) return 0;
-    else                                            return AVPROBE_SCORE_MAX/2;
+    if (p->buf_size < 4 || memcmp(p->buf, "fLaC", 4))
+        return 0;
+    return AVPROBE_SCORE_EXTENSION;
 }
 
 AVInputFormat ff_flac_demuxer = {