[FFmpeg-devel] [PATCH] avformat/movenc: Fix segfault upon allocation error

Jan Ekström jeebjp at gmail.com
Mon Sep 28 20:13:27 EEST 2020


On Mon, Sep 28, 2020 at 6:14 PM Andreas Rheinhardt
<andreas.rheinhardt at gmail.com> wrote:
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavformat/movenc.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 63adae5e0a..a90bbfa458 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -6254,6 +6254,9 @@ static void mov_free(AVFormatContext *s)
>      MOVMuxContext *mov = s->priv_data;
>      int i;
>
> +    if (!mov->tracks)
> +        return;
> +
>      if (mov->chapter_track) {
>          avcodec_parameters_free(&mov->tracks[mov->chapter_track].par);
>      }
> --
> 2.25.1

LGTM.

Jan


More information about the ffmpeg-devel mailing list