History

avformat/cafdec: improve probing

Paul B Mahol committed 3 years ago

Commit 36552911 parent ea063171 file · +9 −3Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/cafdec.c+9−3
@@ -52,9 +52,15 @@ typedef struct CafContext { · 51 unmodified lines
5252
5353 static int probe(const AVProbeData *p)
5454 {
55− if (AV_RB32(p->buf) == MKBETAG('c','a','f','f') && AV_RB16(&p->buf[4]) == 1)
56− return AVPROBE_SCORE_MAX;
57− return 0;
55+ if (AV_RB32(p->buf) != MKBETAG('c','a','f','f'))
56+ return 0;
57+ if (AV_RB16(&p->buf[4]) != 1)
58+ return 0;
59+ if (AV_RB32(p->buf + 8) != MKBETAG('d','e','s','c'))
60+ return 0;
61+ if (AV_RB64(p->buf + 12) != 32)
62+ return 0;
63+ return AVPROBE_SCORE_MAX;
5864 }
5965
6066 /** Read audio description chunk */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t