avformat/mux: Check that deinit is set before calling it
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 24 Apr 2016 10:07:37 +0000 (12:07 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 24 Apr 2016 10:07:37 +0000 (12:07 +0200)
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mux.c

index 6239fd1..91388e3 100644 (file)
@@ -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;
     }