diff mbox

[FFmpeg-devel,01/16] avformat/hlsenc: Fix leak of child AVFormatContext

Message ID 20191216000418.24707-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 7d6637bcc4bb6d1d554e910a4afd6cf6711f8862
Headers show

Commit Message

Andreas Rheinhardt Dec. 16, 2019, 12:04 a.m. UTC
Before ed897633, the hls muxer would free its child AVFormatContexts
and reset the pointer to these contexts to NULL immediately afterwards;
ed897633 moved the former to later (into a separate function), but kept
the resetting, ensuring that the child context leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/hlsenc.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Liu Steven Dec. 16, 2019, 2:49 a.m. UTC | #1
> 在 2019年12月16日,08:04,Andreas Rheinhardt <andreas.rheinhardt@gmail.com> 写道:
> 
> Before ed897633, the hls muxer would free its child AVFormatContexts
> and reset the pointer to these contexts to NULL immediately afterwards;
> ed897633 moved the former to later (into a separate function), but kept
> the resetting, ensuring that the child context leaks.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> libavformat/hlsenc.c | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 6f36a23cbe..2b87070d62 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2631,7 +2631,6 @@ failed:
>         }
>         ffio_free_dyn_buf(&oc->pb);
> 
> -        vs->avf = NULL;
>         av_free(old_filename);
>     }
> 
> -- 
> 2.20.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

LGTM

Thanks
Steven
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 6f36a23cbe..2b87070d62 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2631,7 +2631,6 @@  failed:
         }
         ffio_free_dyn_buf(&oc->pb);
 
-        vs->avf = NULL;
         av_free(old_filename);
     }