From c84ba07db4abd123b2ad93784e312a24d9341553 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 24 Apr 2016 12:07:37 +0200 Subject: [PATCH] avformat/mux: Check that deinit is set before calling it Fixes null pointer dereference Signed-off-by: Michael Niedermayer --- libavformat/mux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }