]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avr.c
Merge commit '7671dd7cd7d51bbd637cc46d8f104a141bc355ea'
[ffmpeg] / libavformat / avr.c
index 02edf451a82f383171454e1bbb89f737139d59a1..a33134eed529effe0c34ed8272512592a2476604 100644 (file)
 
 static int avr_probe(AVProbeData *p)
 {
-    if (AV_RL32(p->buf) == MKTAG('2', 'B', 'I', 'T'))
-        return AVPROBE_SCORE_EXTENSION;
-    return 0;
+    if (AV_RL32(p->buf) != MKTAG('2', 'B', 'I', 'T'))
+        return 0;
+
+    if (!AV_RB16(p->buf+12) || AV_RB16(p->buf+12) > 256) // channels
+        return AVPROBE_SCORE_EXTENSION/2;
+    if (AV_RB16(p->buf+14) > 256) // bps
+        return AVPROBE_SCORE_EXTENSION/2;
+
+    return AVPROBE_SCORE_EXTENSION;
 }
 
 static int avr_read_header(AVFormatContext *s)