1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Check for out of bound writes in the avs demuxer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Laurent Aimar 2011-10-01 00:44:55 +02:00 committed by Michael Niedermayer
parent 1cce7def0a
commit 5d44c061cf

View File

@ -169,6 +169,8 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
switch (type) { switch (type) {
case AVS_PALETTE: case AVS_PALETTE:
if (size - 4 > sizeof(palette))
return AVERROR_INVALIDDATA;
ret = avio_read(s->pb, palette, size - 4); ret = avio_read(s->pb, palette, size - 4);
if (ret < size - 4) if (ret < size - 4)
return AVERROR(EIO); return AVERROR(EIO);