Browse Source

avformat/avr: check channels and bps in probe

Fixes probetest failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
650fd9c004
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      libavformat/avr.c

+ 9
- 3
libavformat/avr.c View File

@@ -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)


Loading…
Cancel
Save