summaryrefslogtreecommitdiff
path: root/libavformat/avr.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-11 14:51:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-11 14:51:43 +0100
commit650fd9c004e0093dacf928a015947f7490c0dfbf (patch)
tree3603bde3d56878c4df1282c0e83ad2596c3b5cb3 /libavformat/avr.c
parent676bc505f74ae5596ed42076be6e8ff546b383df (diff)
avformat/avr: check channels and bps in probe
Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avr.c')
-rw-r--r--libavformat/avr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/avr.c b/libavformat/avr.c
index 02edf451a8..a33134eed5 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)