Message ID | 20200928151418.616962-1-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel] avformat/movenc: Fix segfault upon allocation error | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On Mon, Sep 28, 2020 at 6:14 PM Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote: > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@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
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); }
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavformat/movenc.c | 3 +++ 1 file changed, 3 insertions(+)