[FFmpeg-cvslog] Check for out of bound writes in the avs demuxer.

Laurent Aimar git at videolan.org
Sun Nov 6 20:18:53 CET 2011


ffmpeg | branch: release/0.5 | Laurent Aimar <fenrir at videolan.org> | Sat Oct  1 00:44:55 2011 +0200| [62da9203fd0c26e075c59eb6a82006de22fdbdc1] | committer: Michael Niedermayer

Check for out of bound writes in the avs demuxer.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 5d44c061cf511d97be5fac8d76be2f3915c6e798)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=62da9203fd0c26e075c59eb6a82006de22fdbdc1
---

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

diff --git a/libavformat/avs.c b/libavformat/avs.c
index 878898e..eda7f9d 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 = get_buffer(s->pb, palette, size - 4);
                 if (ret < size - 4)
                     return AVERROR(EIO);



More information about the ffmpeg-cvslog mailing list