diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-30 23:42:31 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-18 17:50:40 +0100 |
commit | 7fa13e12e6eb0c791578e53a32dd6de0de0f8743 (patch) | |
tree | abda9267061acef172b0612115a15768847f1dcf | |
parent | ab201f6f1bca54324c05f8e7254a7a183999fbfc (diff) | |
download | ffmpeg-7fa13e12e6eb0c791578e53a32dd6de0de0f8743.tar.gz |
avsdemux: check for out of bound writes
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 6de33611c918e6ad5bbc878840a59607cb42b8c0)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavformat/avs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/avs.c b/libavformat/avs.c index 52294b0b40..084d461dc1 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); |