Re: [FFmpeg-devel] [PATCH] tiff: fix leaking yuv_line

2017-02-17 Thread Michael Niedermayer
On Fri, Feb 17, 2017 at 02:05:06AM +0100, Andreas Cadhalpun wrote:
> On 16.02.2017 03:15, Michael Niedermayer wrote:
> > On Thu, Feb 16, 2017 at 12:23:28AM +0100, Andreas Cadhalpun wrote:
> >> Signed-off-by: Andreas Cadhalpun 
> >> ---
> >>  libavcodec/tiff.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> >> index efbd9791a5..474ea90015 100644
> >> --- a/libavcodec/tiff.c
> >> +++ b/libavcodec/tiff.c
> >> @@ -1386,6 +1386,7 @@ static av_cold int tiff_end(AVCodecContext *avctx)
> >>  
> >>  ff_lzw_decode_close(>lzw);
> >>  av_freep(>deinvert_buf);
> >> +av_freep(>yuv_line);
> >>  return 0;
> > 
> > I assume we are missing a test in fate for the yuv case
> > adding such test would be usefull
> 
> Indeed, I'll send a patch adding one.
> 
> > yuv_line_size should be reset to 0, not sure its ever needed but it
> > feels more proper
> 
> It's in the close function, so it's unlikely to be needed, but I added
> it now anyway. Updated patch is attached. 
> 
> Best regards,
> Andreas

>  tiff.c |2 ++
>  1 file changed, 2 insertions(+)
> e3de2fb1a9c5034573fe4690bb71231bece1  0001-tiff-fix-leaking-yuv_line.patch
> From c9a5c531c1d0434c989998eab6cb1ac352200695 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun 
> Date: Thu, 16 Feb 2017 00:07:24 +0100
> Subject: [PATCH] tiff: fix leaking yuv_line
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  libavcodec/tiff.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index efbd9791a5..650a9d89ef 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -1386,6 +1386,8 @@ static av_cold int tiff_end(AVCodecContext *avctx)
>  
>  ff_lzw_decode_close(>lzw);
>  av_freep(>deinvert_buf);
> +av_freep(>yuv_line);
> +s->yuv_line_size = 0;

LGTM

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] tiff: fix leaking yuv_line

2017-02-16 Thread Andreas Cadhalpun
On 16.02.2017 03:15, Michael Niedermayer wrote:
> On Thu, Feb 16, 2017 at 12:23:28AM +0100, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  libavcodec/tiff.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
>> index efbd9791a5..474ea90015 100644
>> --- a/libavcodec/tiff.c
>> +++ b/libavcodec/tiff.c
>> @@ -1386,6 +1386,7 @@ static av_cold int tiff_end(AVCodecContext *avctx)
>>  
>>  ff_lzw_decode_close(>lzw);
>>  av_freep(>deinvert_buf);
>> +av_freep(>yuv_line);
>>  return 0;
> 
> I assume we are missing a test in fate for the yuv case
> adding such test would be usefull

Indeed, I'll send a patch adding one.

> yuv_line_size should be reset to 0, not sure its ever needed but it
> feels more proper

It's in the close function, so it's unlikely to be needed, but I added
it now anyway. Updated patch is attached. 

Best regards,
Andreas
>From c9a5c531c1d0434c989998eab6cb1ac352200695 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Thu, 16 Feb 2017 00:07:24 +0100
Subject: [PATCH] tiff: fix leaking yuv_line

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/tiff.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index efbd9791a5..650a9d89ef 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1386,6 +1386,8 @@ static av_cold int tiff_end(AVCodecContext *avctx)
 
 ff_lzw_decode_close(>lzw);
 av_freep(>deinvert_buf);
+av_freep(>yuv_line);
+s->yuv_line_size = 0;
 return 0;
 }
 
-- 
2.11.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] tiff: fix leaking yuv_line

2017-02-15 Thread Andreas Cadhalpun
Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/tiff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index efbd9791a5..474ea90015 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1386,6 +1386,7 @@ static av_cold int tiff_end(AVCodecContext *avctx)
 
 ff_lzw_decode_close(>lzw);
 av_freep(>deinvert_buf);
+av_freep(>yuv_line);
 return 0;
 }
 
-- 
2.11.0
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel