From 5a939418fc3e48c9ff9f480ccc4848fdb1ee5ae8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 6 Feb 2017 15:49:13 +0100 Subject: [PATCH] Add missing avcodec_close (Fixes #3741) --- apps/openmw/mwsound/ffmpeg_decoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 651982344..038b2338b 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -242,6 +242,10 @@ void FFmpeg_Decoder::open(const std::string &fname) } catch(std::exception&) { + if(mStream) + avcodec_close((*mStream)->codec); + mStream = NULL; + if (mFormatCtx->pb->buffer != NULL) { av_free(mFormatCtx->pb->buffer);