Commit cbe84b4f authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/astdec: sanity check channels & sample rate

Fixes probetest failure
Reviewed-by: 's avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4684539c
...@@ -27,12 +27,15 @@ ...@@ -27,12 +27,15 @@
static int ast_probe(AVProbeData *p) static int ast_probe(AVProbeData *p)
{ {
if (AV_RL32(p->buf) == MKTAG('S','T','R','M') && if (AV_RL32(p->buf) != MKTAG('S','T','R','M'))
AV_RB16(p->buf + 10) && return 0;
AV_RB16(p->buf + 12) &&
AV_RB32(p->buf + 16)) if (!AV_RB16(p->buf + 10) ||
return AVPROBE_SCORE_MAX / 3 * 2; !AV_RB16(p->buf + 12) || AV_RB16(p->buf + 12) > 256 ||
return 0; !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) static int ast_read_header(AVFormatContext *s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment