[FFmpeg-cvslog] avformat/mpegenc: check for stream private data during deinit

James Almer git at videolan.org
Sat Oct 19 05:15:40 EEST 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Oct 18 23:14:21 2019 -0300| [0700e7247b83934c610a44e0312fb685c78e903c] | committer: James Almer

avformat/mpegenc: check for stream private data during deinit

Prevents pointer dereferences when streams were not fully initialized.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0700e7247b83934c610a44e0312fb685c78e903c
---

 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);
     }
 }



More information about the ffmpeg-cvslog mailing list