]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/interplayvideo.c
Merge commit '2cd4068071b9a8908823a3107f97e938211045ce'
[ffmpeg] / libavcodec / interplayvideo.c
index 3285578a70621b777755c2cc276be1d033b18eb2..e0550a702b37e8ebecfbc0f4fee9ba4cd0b21fad 100644 (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);