X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favr.c;h=a33134eed529effe0c34ed8272512592a2476604;hb=43bf4297e4db95be5901c04ec8e89901c187b01d;hp=02edf451a82f383171454e1bbb89f737139d59a1;hpb=b1f213a83ae8d4fe3fa83a145fdbe6da7fd36a90;p=ffmpeg diff --git a/libavformat/avr.c b/libavformat/avr.c index 02edf451a82..a33134eed52 100644 --- a/libavformat/avr.c +++ b/libavformat/avr.c @@ -26,9 +26,15 @@ 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)