summaryrefslogtreecommitdiff
path: root/libavformat/swfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-12 19:29:08 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-12 19:29:27 +0100
commitabe68364a3219f1a98c46bddea575e4cada147c7 (patch)
tree4be5eaf891a601d5050dad3262c437958b0ed338 /libavformat/swfdec.c
parentd1493d2ce5f598016adff8cda8484529a560fb0d (diff)
swfdec: check space before copy
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r--libavformat/swfdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index b8c2e930c3..193df25e2f 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -362,6 +362,11 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
default:
av_assert0(0);
}
+
+ if (linesize * height > pkt->size) {
+ res = AVERROR_INVALIDDATA;
+ goto bitmap_end;
+ }
memcpy(pkt->data, buf + colormapsize*colormapbpp, linesize * height);
res = pkt->size;