aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/adp.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-12-09 13:51:00 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-12-09 13:51:00 +0100
commitc5a837658acd3e65029e6c8b52dd6cdffdb608b0 (patch)
tree86ac3788f3c91fe6dc38c8654c733ed93b33428a /libavformat/adp.c
parent45fd4ec9ef2b3a7074c49cdddac6e7dcc127a874 (diff)
downloadffmpeg-c5a837658acd3e65029e6c8b52dd6cdffdb608b0.tar.gz
Do not detect "00000000..." (and other non-changing values) as adp.
Diffstat (limited to 'libavformat/adp.c')
-rw-r--r--libavformat/adp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavformat/adp.c b/libavformat/adp.c
index c5feac4fa5..08a4225e46 100644
--- a/libavformat/adp.c
+++ b/libavformat/adp.c
@@ -26,14 +26,21 @@
static int adp_probe(AVProbeData *p)
{
- int i;
+ int i, changes = 0;
+ char last = 0;
if (p->buf_size < 32)
return 0;
- for (i = 0; i < p->buf_size - 3; i+=32)
+ for (i = 0; i < p->buf_size - 3; i+=32) {
if (p->buf[i] != p->buf[i+2] || p->buf[i+1] != p->buf[i+3])
return 0;
+ if (p->buf[i] != last)
+ changes++;
+ last = p->buf[i];
+ }
+ if (changes <= 1)
+ return 0;
return p->buf_size < 260 ? 1 : AVPROBE_SCORE_MAX / 4;
}