Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: ffio_free_dyn_buf the oc->pb at hls_write_trailer

2019-09-11 Thread Andreas Rheinhardt
Steven Liu:
> fix memleak at hls_write_trailer
> 
> Found-by: Andreas Rheinhardt 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/hlsenc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index f881bb9d60..218bfb2cba 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2641,6 +2641,7 @@ failed:
>  ff_format_io_close(s, &vs->out);
>  hls_window(s, 1, vs);
>  }
> +ffio_free_dyn_buf(&oc->pb);
>  avformat_free_context(oc);
>  
>  vs->avf = NULL;
> 
This patch fixes the memleaks I reported. I don't know if anything
ever gets written in av_write_trailer(oc); if yes, it will be
discarded and not output. But if you are ok with this (or know for
sure that it won't happen), it's fine.
There are other memleaks, though: A big one when using HLS_SINGLE_FILE
(more on this in another mail) and then there are three places in
hls_write_trailer where you simply return AVERROR(ENOMEM) when there
is not enough memory available for another string. This guarantees leaks.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: ffio_free_dyn_buf the oc->pb at hls_write_trailer

2019-09-10 Thread Limin Wang

Maybe it's better to change the subject from:
avformat/hlsenc: ffio_free_dyn_buf the oc->pb at hls_write_trailer
to
avformat/hlsenc: fix memleak at hls_write_trailer

On Mon, Sep 09, 2019 at 02:15:21PM +0800, Steven Liu wrote:
> fix memleak at hls_write_trailer
> 
> Found-by: Andreas Rheinhardt 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/hlsenc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index f881bb9d60..218bfb2cba 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2641,6 +2641,7 @@ failed:
>  ff_format_io_close(s, &vs->out);
>  hls_window(s, 1, vs);
>  }
> +ffio_free_dyn_buf(&oc->pb);
>  avformat_free_context(oc);
>  
>  vs->avf = NULL;
> -- 
> 2.17.2 (Apple Git-113)
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/hlsenc: ffio_free_dyn_buf the oc->pb at hls_write_trailer

2019-09-08 Thread Steven Liu
fix memleak at hls_write_trailer

Found-by: Andreas Rheinhardt 
Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f881bb9d60..218bfb2cba 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2641,6 +2641,7 @@ failed:
 ff_format_io_close(s, &vs->out);
 hls_window(s, 1, vs);
 }
+ffio_free_dyn_buf(&oc->pb);
 avformat_free_context(oc);
 
 vs->avf = NULL;
-- 
2.17.2 (Apple Git-113)



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".