diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-10-24 00:41:15 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-10-24 00:41:15 +0400 |
commit | 2fdc6f355cfc462029aff14e2dcf015ac0ecef3d (patch) | |
tree | 9a7d70740e38974385034ead5bb7bf61091736a5 /libavformat | |
parent | 8b03cd3cd7a3141b87419ebce02b9fed7e0030da (diff) |
Do not detect mov with maximum score if the atom size is too small.
Fixes mpegts-in-mov, ticket #987 / issue 2223.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index ce4865d841..d9c509bf1a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2879,7 +2879,14 @@ static int mov_probe(AVProbeData *p) case MKTAG('p','n','o','t'): /* detect movs with preview pics like ew.mov and april.mov */ case MKTAG('u','d','t','a'): /* Packet Video PVAuthor adds this and a lot of more junk */ case MKTAG('f','t','y','p'): - score = AVPROBE_SCORE_MAX; + if (AV_RB32(p->buf+offset) < 8 && + (AV_RB32(p->buf+offset) != 1 || + offset + 12 > (unsigned int)p->buf_size || + AV_RB64(p->buf+offset + 8) == 0)) { + score = FFMAX(score, AVPROBE_SCORE_MAX - 50); + } else { + score = AVPROBE_SCORE_MAX; + } offset = FFMAX(4, AV_RB32(p->buf+offset)) + offset; break; /* those are more common words, so rate then a bit less */ |