avformat/aiffdec: improve probe

This commit is contained in:
Paul B Mahol 2023-09-12 10:56:53 +02:00
parent aeff5bcba0
commit a18ccbfaeb

View File

@ -202,8 +202,8 @@ static int get_aiff_header(AVFormatContext *s, int64_t size,
static int aiff_probe(const AVProbeData *p)
{
/* check file header */
if (p->buf[0] == 'F' && p->buf[1] == 'O' &&
p->buf[2] == 'R' && p->buf[3] == 'M' &&
if (AV_RL32(p->buf) == MKTAG('F', 'O', 'R', 'M') &&
AV_RB32(p->buf + 4) >= 4 &&
p->buf[8] == 'A' && p->buf[9] == 'I' &&
p->buf[10] == 'F' && (p->buf[11] == 'F' || p->buf[11] == 'C'))
return AVPROBE_SCORE_MAX;