summaryrefslogtreecommitdiff
path: root/libavformat/swfdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2015-08-04 21:32:01 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-08-04 21:34:00 +0200
commit128e722bc10197320eef6c0f9948be7857afba86 (patch)
tree8bde01df3f41c71c93b4dc323354377007324582 /libavformat/swfdec.c
parentf0b7882ceb791ff32267ad97bd21a09e9cbf83d5 (diff)
downloadffmpeg-128e722bc10197320eef6c0f9948be7857afba86.tar.gz
lavf/swf: Fix auto-detection of compressed files.
Fixes auto-detection of compressed swf files as in http://samples.ffmpeg.org/SWF/compressed-swf/ Reported by forum user Zard1096.
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r--libavformat/swfdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 31c26f8bd4..ce1ad8fc9f 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -67,6 +67,10 @@ static int swf_probe(AVProbeData *p)
&& AV_RB24(p->buf) != AV_RB24("FWS"))
return 0;
+ if ( AV_RB24(p->buf) == AV_RB24("CWS")
+ && p->buf[3] <= 20)
+ return AVPROBE_SCORE_MAX / 4 + 1;
+
init_get_bits8(&gb, p->buf + 3, p->buf_size - 3);
skip_bits(&gb, 40);