summaryrefslogtreecommitdiff
path: root/libavformat/omadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-04 22:19:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-04 22:46:22 +0100
commitbd75651378da81b8d75640c3f12765a4b9369534 (patch)
treef7ecd397520b6c3705b7b08fca4a1a2a4d05d12f /libavformat/omadec.c
parentaeaca3816c2677bfdb16cbc6bc55c259ed5028ff (diff)
parent0a7fef39fc578bd7c90fd2646299f8cad722ecb1 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: omadec: loosen format probing constraints Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/omadec.c')
-rw-r--r--libavformat/omadec.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index d18d61c208..6a08076f47 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -439,23 +439,16 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
static int oma_read_probe(AVProbeData *p)
{
- const uint8_t *buf;
+ const uint8_t *buf = p->buf;
unsigned tag_len = 0;
- buf = p->buf;
-
- if (p->buf_size < ID3v2_HEADER_SIZE ||
- !ff_id3v2_match(buf, ID3v2_EA3_MAGIC) ||
- buf[3] != 3 || // version must be 3
- buf[4]) // flags byte zero
- return 0;
-
- tag_len = ff_id3v2_tag_len(buf);
+ if (p->buf_size >= ID3v2_HEADER_SIZE && ff_id3v2_match(buf, ID3v2_EA3_MAGIC))
+ tag_len = ff_id3v2_tag_len(buf);
/* This check cannot overflow as tag_len has at most 28 bits */
if (p->buf_size < tag_len + 5)
/* EA3 header comes late, might be outside of the probe buffer */
- return AVPROBE_SCORE_EXTENSION;
+ return tag_len ? AVPROBE_SCORE_EXTENSION : 0;
buf += tag_len;