aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/swf.c
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2005-07-02 21:59:33 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2005-07-02 21:59:33 +0000
commite227d197e4ffe1eff80d71acff4649df48a20748 (patch)
tree88e96781ea835b70c6e61ee875a4444f42254fc2 /libavformat/swf.c
parent41a33f51d2fcff50bd587acc6e88d08ca40c0da9 (diff)
downloadffmpeg-e227d197e4ffe1eff80d71acff4649df48a20748.tar.gz
tell the user if compressed swf found
Originally committed as revision 4419 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/swf.c')
-rw-r--r--libavformat/swf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/swf.c b/libavformat/swf.c
index 1a254b82ca..347c824c6f 100644
--- a/libavformat/swf.c
+++ b/libavformat/swf.c
@@ -713,6 +713,7 @@ static int get_swf_tag(ByteIOContext *pb, int *len_ptr)
if (len == 0x3f) {
len = get_le32(pb);
}
+// av_log(NULL, AV_LOG_DEBUG, "Tag: %d - Len: %d\n", tag, len);
*len_ptr = len;
return tag;
}
@@ -723,7 +724,7 @@ static int swf_probe(AVProbeData *p)
/* check file header */
if (p->buf_size <= 16)
return 0;
- if (p->buf[0] == 'F' && p->buf[1] == 'W' &&
+ if ((p->buf[0] == 'F' || p->buf[0] == 'C') && p->buf[1] == 'W' &&
p->buf[2] == 'S')
return AVPROBE_SCORE_MAX;
else
@@ -744,7 +745,14 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1;
s->priv_data = swf;
- if ((get_be32(pb) & 0xffffff00) != MKBETAG('F', 'W', 'S', 0))
+ tag = get_be32(pb) & 0xffffff00;
+
+ if (tag == MKBETAG('C', 'W', 'S', 0))
+ {
+ av_log(s, AV_LOG_ERROR, "Compressed SWF format not supported\n");
+ return AVERROR_IO;
+ }
+ if (tag != MKBETAG('F', 'W', 'S', 0))
return AVERROR_IO;
get_le32(pb);
/* skip rectangle size */