1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-05-08 18:41:25 +00:00

Handle exception if we try to play non-music file (bug #4416)

This commit is contained in:
Andrei Kortunov 2018-06-14 21:32:40 +04:00
parent ccfc07e7e3
commit 2854f6ca83
2 changed files with 13 additions and 9 deletions

View file

@ -22,6 +22,7 @@
Bug #4327: Missing animations during spell/weapon stance switching Bug #4327: Missing animations during spell/weapon stance switching
Bug #4368: Settings window ok button doesn't have key focus by default Bug #4368: Settings window ok button doesn't have key focus by default
Bug #4393: NPCs walk back to where they were after using ResetActors Bug #4393: NPCs walk back to where they were after using ResetActors
Bug #4416: Handle exception if we try to play non-music file
Bug #4419: MRK NiStringExtraData is handled incorrectly Bug #4419: MRK NiStringExtraData is handled incorrectly
Bug #4426: RotateWorld behavior is incorrect Bug #4426: RotateWorld behavior is incorrect
Bug #4429: [Windows] Error on build INSTALL.vcxproj project (debug) with cmake 3.7.2 Bug #4429: [Windows] Error on build INSTALL.vcxproj project (debug) with cmake 3.7.2

View file

@ -251,21 +251,24 @@ void FFmpeg_Decoder::open(const std::string &fname)
if(mOutputChannelLayout == 0) if(mOutputChannelLayout == 0)
mOutputChannelLayout = av_get_default_channel_layout((*mStream)->codec->channels); mOutputChannelLayout = av_get_default_channel_layout((*mStream)->codec->channels);
} }
catch(...) { catch(...)
{
if(mStream) if(mStream)
avcodec_close((*mStream)->codec); avcodec_close((*mStream)->codec);
mStream = NULL; mStream = NULL;
if (mFormatCtx->pb->buffer != NULL) if (mFormatCtx != NULL)
{ {
av_free(mFormatCtx->pb->buffer); if (mFormatCtx->pb->buffer != NULL)
mFormatCtx->pb->buffer = NULL; {
} av_free(mFormatCtx->pb->buffer);
av_free(mFormatCtx->pb); mFormatCtx->pb->buffer = NULL;
mFormatCtx->pb = NULL; }
av_free(mFormatCtx->pb);
mFormatCtx->pb = NULL;
avformat_close_input(&mFormatCtx); avformat_close_input(&mFormatCtx);
throw; }
} }
} }