mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-27 09:52:17 +00:00
avformat/rsd: Check channels and sample_rate fields
Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a35e30b672
commit
50a3c4c5d2
@ -43,10 +43,13 @@ static const uint32_t rsd_unsupported_tags[] = {
|
||||
|
||||
static int rsd_probe(AVProbeData *p)
|
||||
{
|
||||
if (!memcmp(p->buf, "RSD", 3) &&
|
||||
p->buf[3] - '0' >= 2 && p->buf[3] - '0' <= 6)
|
||||
return AVPROBE_SCORE_EXTENSION;
|
||||
return 0;
|
||||
if (memcmp(p->buf, "RSD", 3) || p->buf[3] - '0' < 2 || p->buf[3] - '0' > 6)
|
||||
return 0;
|
||||
if (AV_RL32(p->buf + 8) > 256 || !AV_RL32(p->buf + 8))
|
||||
return 1;
|
||||
if (AV_RL32(p->buf + 16) > 8*48000 || !AV_RL32(p->buf + 16))
|
||||
return 1;
|
||||
return AVPROBE_SCORE_EXTENSION;
|
||||
}
|
||||
|
||||
static int rsd_read_header(AVFormatContext *s)
|
||||
|
Loading…
Reference in New Issue
Block a user