]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mpegenc: check for stream private data during deinit
authorJames Almer <jamrial@gmail.com>
Sat, 19 Oct 2019 02:14:21 +0000 (23:14 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 19 Oct 2019 02:14:40 +0000 (23:14 -0300)
Prevents pointer dereferences when streams were not fully initialized.

Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/mpegenc.c

index 93f40b202c931a51d992a9f0068db9967cc24b24..f6980231a20d19fdf0755acde39a904a419b2482 100644 (file)
@@ -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);
     }
 }