From 0700e7247b83934c610a44e0312fb685c78e903c Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 18 Oct 2019 23:14:21 -0300 Subject: [PATCH] avformat/mpegenc: check for stream private data during deinit Prevents pointer dereferences when streams were not fully initialized. Signed-off-by: James Almer --- libavformat/mpegenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 93f40b202c..f6980231a2 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -1258,6 +1258,8 @@ static void mpeg_mux_deinit(AVFormatContext *ctx) { for (int i = 0; i < ctx->nb_streams; i++) { StreamInfo *stream = ctx->streams[i]->priv_data; + if (!stream) + continue; av_fifo_freep(&stream->fifo); } }