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

interplayvideo: Free previous frames on resolution changes.

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-31 00:45:24 +01:00
parent 9c50e69385
commit 9df9420dea

View File

@ -969,6 +969,13 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
if (buf_size < s->decoding_map_size)
return buf_size;
if (s->last_frame.data[0] && av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, NULL)) {
if (s->last_frame.data[0])
avctx->release_buffer(avctx, &s->last_frame);
if (s->second_last_frame.data[0])
avctx->release_buffer(avctx, &s->second_last_frame);
}
s->decoding_map = buf;
bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
buf_size - s->decoding_map_size);