History

avformat/cafdec: improve probing

Paul B Mahol committed 3 years ago

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

Unified · Split

libavformat/cafdec.c+9−3
@@ -52,9 +52,15 @@ typedef struct CafContext { · 51 unmodified lines
52 52
53static int probe(const AVProbeData *p)53static int probe(const AVProbeData *p)
54{54{
55 if (AV_RB32(p->buf) == MKBETAG('c','a','f','f') && AV_RB16(&p->buf[4]) == 1)55 if (AV_RB32(p->buf) != MKBETAG('c','a','f','f'))
56 return AVPROBE_SCORE_MAX;56 return 0;
57 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;
58}64}
59 65
60/** Read audio description chunk */66/** 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