[FFmpeg-devel] [PATCH 02/12] Check for out of bound writes in the avs demuxer.

fenrir at elivagar.org fenrir at elivagar.org
Sat Oct 1 00:44:55 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

---
 libavformat/avs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/avs.c b/libavformat/avs.c
index 7b90f85..ad5ac05 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);
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list