Browse Source

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>
tags/n3.1.6
Andreas Cadhalpun 9 years ago
parent
commit
6a7f0585ab
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavformat/icodec.c

+ 8
- 0
libavformat/icodec.c View File

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

Loading…
Cancel
Save