Commit d54c95a1 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

icodec: add ico_read_close to fix leaking ico->images

Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 467eece1
......@@ -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,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment