diff mbox

[FFmpeg-devel,2/2] iocodec: add ico_read_close to fix leaking ico->images

Message ID 90f96d35-cd83-ce77-6f37-c3a80c34f8fe@googlemail.com
State Accepted
Commit d54c95a1435a8a3fcd599108ec85b7f56a0fcbf9
Headers show

Commit Message

Andreas Cadhalpun Nov. 8, 2016, 11 p.m. UTC
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavformat/icodec.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Moritz Barsnick Nov. 8, 2016, 11:28 p.m. UTC | #1
On Wed, Nov 09, 2016 at 00:00:09 +0100, Andreas Cadhalpun wrote:
> [PATCH 2/2] iocodec: add ico_read_close to fix leaking ico->images  
              ^ icodec

M.
Andreas Cadhalpun Nov. 8, 2016, 11:40 p.m. UTC | #2
On 09.11.2016 00:28, Moritz Barsnick wrote:
> On Wed, Nov 09, 2016 at 00:00:09 +0100, Andreas Cadhalpun wrote:
>> [PATCH 2/2] iocodec: add ico_read_close to fix leaking ico->images  
>               ^ icodec

Fixed locally.

Best regards,
Andreas
Michael Niedermayer Nov. 9, 2016, 4:27 p.m. UTC | #3
On Wed, Nov 09, 2016 at 12:00:09AM +0100, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
> ---
>  libavformat/icodec.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

LGTM with te typo fix

thx

[...]
Andreas Cadhalpun Nov. 9, 2016, 8:19 p.m. UTC | #4
On 09.11.2016 17:27, Michael Niedermayer wrote:
> On Wed, Nov 09, 2016 at 12:00:09AM +0100, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>> ---
>>  libavformat/icodec.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
> 
> LGTM with te typo fix

Typo fixed and pushed.

Best regards,
Andreas
diff mbox

Patch

diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index becbc0f..1d8e383 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,
 };