diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-09-21 22:18:12 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-09-21 22:41:10 +0200 |
commit | 365529178dfd23ed79acf780effbaa8ed2a263f9 (patch) | |
tree | 0a458e2e308cf1c36a26a99b267ee642ec979260 /libavformat/cafdec.c | |
parent | ea063171903638541a8debded3a828456dd73fc9 (diff) | |
download | ffmpeg-365529178dfd23ed79acf780effbaa8ed2a263f9.tar.gz |
avformat/cafdec: improve probing
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r-- | libavformat/cafdec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index e0a9031cb8..f5ba0f4108 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -52,9 +52,15 @@ typedef struct CafContext { static int probe(const AVProbeData *p) { - if (AV_RB32(p->buf) == MKBETAG('c','a','f','f') && AV_RB16(&p->buf[4]) == 1) - return AVPROBE_SCORE_MAX; - return 0; + if (AV_RB32(p->buf) != MKBETAG('c','a','f','f')) + return 0; + if (AV_RB16(&p->buf[4]) != 1) + return 0; + if (AV_RB32(p->buf + 8) != MKBETAG('d','e','s','c')) + return 0; + if (AV_RB64(p->buf + 12) != 32) + return 0; + return AVPROBE_SCORE_MAX; } /** Read audio description chunk */ |