[FFmpeg-devel,1/4] lavf/movenc: fix leak of eac3_priv

Submitted by Rodger Combs on March 13, 2018, 4:46 a.m.

Details

Message ID 20180313044648.40735-1-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs March 13, 2018, 4:46 a.m.
This could previously happen in error or early-exit cases. The next commit
would make it happen in all cases.
---
 libavformat/movenc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer March 14, 2018, 2:17 a.m.
On Mon, Mar 12, 2018 at 11:46:45PM -0500, Rodger Combs wrote:
> This could previously happen in error or early-exit cases. The next commit
> would make it happen in all cases.
> ---
>  libavformat/movenc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 5b1e66c897..353a42ae2c 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -5772,6 +5772,7 @@ static void mov_free(AVFormatContext *s)
>              av_freep(&mov->tracks[i].par);
>          av_freep(&mov->tracks[i].cluster);
>          av_freep(&mov->tracks[i].frag_info);
> +        av_freep(&mov->tracks[i].eac3_priv);
>  
>          if (mov->tracks[i].vos_len)
>              av_freep(&mov->tracks[i].vos_data);

eac3_priv.pkt may need freeing too


[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5b1e66c897..353a42ae2c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5772,6 +5772,7 @@  static void mov_free(AVFormatContext *s)
             av_freep(&mov->tracks[i].par);
         av_freep(&mov->tracks[i].cluster);
         av_freep(&mov->tracks[i].frag_info);
+        av_freep(&mov->tracks[i].eac3_priv);
 
         if (mov->tracks[i].vos_len)
             av_freep(&mov->tracks[i].vos_data);