diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-08 23:54:41 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-09 21:10:41 +0100 |
commit | d54c95a1435a8a3fcd599108ec85b7f56a0fcbf9 (patch) | |
tree | 0c2cd2d224847e297bd0737bbc24abce10567a58 /libavformat/icodec.c | |
parent | 467eece1bea5c8325c6974190ba61f1bba88a3f3 (diff) | |
download | ffmpeg-d54c95a1435a8a3fcd599108ec85b7f56a0fcbf9.tar.gz |
icodec: add ico_read_close to fix leaking ico->images
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/icodec.c')
-rw-r--r-- | libavformat/icodec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/icodec.c b/libavformat/icodec.c index fa985fb313..a0e126a390 100644 --- a/libavformat/icodec.c +++ b/libavformat/icodec.c @@ -199,6 +199,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"), @@ -206,5 +213,6 @@ AVInputFormat ff_ico_demuxer = { .read_probe = probe, .read_header = read_header, .read_packet = read_packet, + .read_close = ico_read_close, .flags = AVFMT_NOTIMESTAMPS, }; |