summaryrefslogtreecommitdiff
path: root/libavformat/astdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-06 13:12:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-07 14:58:34 +0100
commitcbe84b4ffae4619417e119ed63d7c49826feac81 (patch)
tree4dfded3edd0cdda4aa5c419941d0f46d940a125c /libavformat/astdec.c
parent4684539c9148050ad26a8b840c4b5ee33799865d (diff)
downloadffmpeg-cbe84b4ffae4619417e119ed63d7c49826feac81.tar.gz
avformat/astdec: sanity check channels & sample rate
Fixes probetest failure Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/astdec.c')
-rw-r--r--libavformat/astdec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavformat/astdec.c b/libavformat/astdec.c
index 886274410d..12252dcb67 100644
--- a/libavformat/astdec.c
+++ b/libavformat/astdec.c
@@ -27,12 +27,15 @@
static int ast_probe(AVProbeData *p)
{
- if (AV_RL32(p->buf) == MKTAG('S','T','R','M') &&
- AV_RB16(p->buf + 10) &&
- AV_RB16(p->buf + 12) &&
- AV_RB32(p->buf + 16))
- return AVPROBE_SCORE_MAX / 3 * 2;
- return 0;
+ if (AV_RL32(p->buf) != MKTAG('S','T','R','M'))
+ return 0;
+
+ if (!AV_RB16(p->buf + 10) ||
+ !AV_RB16(p->buf + 12) || AV_RB16(p->buf + 12) > 256 ||
+ !AV_RB32(p->buf + 16) || AV_RB32(p->buf + 16) > 8*48000)
+ return 1;
+
+ return AVPROBE_SCORE_MAX / 3 * 2;
}
static int ast_read_header(AVFormatContext *s)