mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-24 07:46:56 +00:00
lavf/flacdec: Return maximum score if the streaminfo header is valid.
Fixes ticket #6208.
(cherry picked from commit 3733039610
)
This commit is contained in:
parent
a60e665162
commit
582c3d514a
@ -233,7 +233,14 @@ static int flac_probe(AVProbeData *p)
|
||||
return raw_flac_probe(p);
|
||||
if (p->buf_size < 4 || memcmp(p->buf, "fLaC", 4))
|
||||
return 0;
|
||||
return AVPROBE_SCORE_EXTENSION;
|
||||
if ( p->buf[4] & 0x7f != FLAC_METADATA_TYPE_STREAMINFO
|
||||
|| AV_RB24(p->buf + 5) != FLAC_STREAMINFO_SIZE
|
||||
|| AV_RB16(p->buf + 8) < 16
|
||||
|| AV_RB16(p->buf + 8) > AV_RB16(p->buf + 10)
|
||||
|| !(AV_RB24(p->buf + 18) >> 4)
|
||||
|| AV_RB24(p->buf + 18) >> 4 > 655350)
|
||||
return AVPROBE_SCORE_EXTENSION;
|
||||
return AVPROBE_SCORE_MAX;
|
||||
}
|
||||
|
||||
static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_index,
|
||||
|
Loading…
Reference in New Issue
Block a user