[FFmpeg-cvslog] icodec: add ico_read_close to fix leaking ico->images
Andreas Cadhalpun
git at videolan.org
Sun Nov 27 01:41:10 EET 2016
ffmpeg | branch: release/3.0 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Tue Nov 8 23:54:41 2016 +0100| [05e6606ba98a53f10213b2f8b07afc3e62731c5a] | committer: Andreas Cadhalpun
icodec: add ico_read_close to fix leaking ico->images
Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit d54c95a1435a8a3fcd599108ec85b7f56a0fcbf9)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05e6606ba98a53f10213b2f8b07afc3e62731c5a
---
libavformat/icodec.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index e866cf9..ca1fa78 100644
--- a/libavformat/icodec.c
+++ b/libavformat/icodec.c
@@ -195,6 +195,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static int ico_read_close(AVFormatContext * s)
+{
+ IcoDemuxContext *ico = s->priv_data;
+ av_freep(&ico->images);
+ return 0;
+}
+
AVInputFormat ff_ico_demuxer = {
.name = "ico",
.long_name = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"),
@@ -202,5 +209,6 @@ AVInputFormat ff_ico_demuxer = {
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,
+ .read_close = ico_read_close,
.flags = AVFMT_NOTIMESTAMPS,
};
More information about the ffmpeg-cvslog
mailing list