avformat/mux: Check that deinit is set before calling it

Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-04-24 12:07:37 +02:00
parent dbe1dd59e0
commit c84ba07db4
1 changed files with 2 additions and 1 deletions

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