From: Anthony Minessale Date: Thu, 29 Jun 2017 22:58:49 +0000 (-0500) Subject: FS-10433: [mod_av,mod_conference] Crash when video recording fails to setup properly... X-Git-Tag: v1.6.19~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2756c96f9d1719eff0d255d03aa727075aff2043;p=thirdparty%2Ffreeswitch.git FS-10433: [mod_av,mod_conference] Crash when video recording fails to setup properly -- fix regression --- diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index a252cfcc6d..e93ba1a00a 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -2245,10 +2245,10 @@ static switch_status_t av_file_close(switch_file_handle_t *handle) } if (context->fc) { - if (context->has_video) { + if (context->has_video && switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) { av_write_trailer(context->fc); } - + mod_avformat_destroy_output_context(context); }