[FFmpeg-cvslog] interplayvideo: Free previous frames on resolution changes.

Michael Niedermayer git at videolan.org
Thu Jan 31 00:56:58 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 31 00:45:24 2013 +0100| [9df9420dea0fc4c523dabc1bb6186c98885bdd9f] | committer: Michael Niedermayer

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 at gmx.at>

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

 libavcodec/interplayvideo.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 3285578..e0550a7 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -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);



More information about the ffmpeg-cvslog mailing list