diff --git a/libavformat/mux.c b/libavformat/mux.c index 6239fd192d..91388e3790 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -424,7 +424,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (s->oformat->init && (ret = s->oformat->init(s)) < 0) { - s->oformat->deinit(s); + if (s->oformat->deinit) + s->oformat->deinit(s); goto fail; }