aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-10 17:20:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-10 17:25:44 +0100
commitc73685398dee3290dd9f67013f1cd310b7f9fb33 (patch)
treed2f0901e3250374dbfbea44772ce5c53e6309128 /libavformat
parenta354839bfaa4647788c7fef7deb7a671d86c709f (diff)
downloadffmpeg-c73685398dee3290dd9f67013f1cd310b7f9fb33.tar.gz
swfdec: check lens validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/swfdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index b8100cb3fe..eb71208060 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -155,6 +155,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;