summaryrefslogtreecommitdiff
path: root/libavformat/avs.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-30 23:42:31 +0000
committerJanne Grunau <janne-libav@jannau.net>2011-10-10 21:36:12 +0200
commit6de33611c918e6ad5bbc878840a59607cb42b8c0 (patch)
treedc4713c941a5c4a76a7bf7bb34b54a4449ff46c5 /libavformat/avs.c
parentde049a95f4a8089b2878c7fcef6cac7e88a8f1bf (diff)
downloadffmpeg-6de33611c918e6ad5bbc878840a59607cb42b8c0.tar.gz
avsdemux: check for out of bound writes
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavformat/avs.c')
-rw-r--r--libavformat/avs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/avs.c b/libavformat/avs.c
index 1c699fbf3c..cc0e849bc2 100644
--- a/libavformat/avs.c
+++ b/libavformat/avs.c
@@ -169,6 +169,8 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
switch (type) {
case AVS_PALETTE:
+ if (size - 4 > sizeof(palette))
+ return AVERROR_INVALIDDATA;
ret = avio_read(s->pb, palette, size - 4);
if (ret < size - 4)
return AVERROR(EIO);