aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/aacdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-16 22:25:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-16 22:25:15 +0100
commit6dd007ad99f9fad84c3e50d09ded676fef48b9b0 (patch)
tree1b5af4774c24f0c48fdce95b4d9f5606408c8052 /libavformat/aacdec.c
parentb74792a02721b7d12de7f6fa997922c2a237e147 (diff)
parent0412cb67cda05b08dfca6bfc4ff664ea917fa932 (diff)
downloadffmpeg-6dd007ad99f9fad84c3e50d09ded676fef48b9b0.tar.gz
Merge commit '0412cb67cda05b08dfca6bfc4ff664ea917fa932'
* commit '0412cb67cda05b08dfca6bfc4ff664ea917fa932': aacdec: Don't count probed ADTS frames if there are false positives Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aacdec.c')
-rw-r--r--libavformat/aacdec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index c7ff69de7e..d58d6d4b4b 100644
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -43,8 +43,16 @@ static int adts_aac_probe(AVProbeData *p)
for (frames = 0; buf2 < end; frames++) {
uint32_t header = AV_RB16(buf2);
- if ((header & 0xFFF6) != 0xFFF0)
+ if ((header & 0xFFF6) != 0xFFF0) {
+ if (buf != buf0) {
+ // Found something that isn't an ADTS header, starting
+ // from a position other than the start of the buffer.
+ // Discard the count we've accumulated so far since it
+ // probably was a false positive.
+ frames = 0;
+ }
break;
+ }
fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;
if (fsize < 7)
break;