From 66fc2502b2120eab99fc638e0f2146ae0512fb31 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 10 Apr 2017 13:15:59 -0500 Subject: [PATCH] FS-10100: [mod_av] fix crash on allocation error and other error cases opening a file --- src/mod/applications/mod_av/avformat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 8580065255..a724a86687 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -1953,7 +1953,11 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa end: - if (context && context->fc) { + if (!context) { + return status; + } + + if (context->fc) { mod_avformat_destroy_output_context(context); }