1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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>
(cherry picked from commit d54c95a143)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun 2016-11-08 23:54:41 +01:00
parent c3307f7e9e
commit 05e6606ba9

View File

@ -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,
};