aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/swfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-10 17:20:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-07-21 01:13:10 +0200
commit9c7c2abad4a8eb56472dd5651522530855a62f3f (patch)
tree4705203b1ed1153c3f3f1e4d341f6c5d3ece28b5 /libavformat/swfdec.c
parentb896c1c98e067040932573c40b1f1879962ebff2 (diff)
downloadffmpeg-9c7c2abad4a8eb56472dd5651522530855a62f3f.tar.gz
swfdec: check lens validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit c73685398dee3290dd9f67013f1cd310b7f9fb33) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 6136b54b05..9a8ef53738 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -153,6 +153,10 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
tag = get_swf_tag(pb, &len);
if (tag < 0)
return tag;
+ if (len < 0) {
+ av_log(s, AV_LOG_ERROR, "len %d is invalid\n", len);
+ return AVERROR_INVALIDDATA;
+ }
if (tag == TAG_VIDEOSTREAM) {
int ch_id = avio_rl16(pb);
len -= 2;