Skip to content

Commit 1da0ab0

Browse files
intel-mediadevgfxVPLsdm
authored andcommitted
[Decode] Fix UNCAUGHT_EXCEPT in AV1/H264/H265 decoder destructors
Wrap Close() calls in VideoDECODEAV1, VideoDECODEH264, and VideoDECODEH265 destructors with try { } catch (...) { } to prevent exceptions from propagating out of implicitly-noexcept destructors. Close() acquires mutexes (std::lock_guard<std::mutex> or UMC::AutomaticUMCMutex) which can throw std::system_error or std::bad_alloc on lock failure. Since C++11 destructors are implicitly noexcept, any uncaught exception causes std::terminate(). Fixes Coverity CIDs: 2893009 (AV1), 3593332 (H264), 3593335 (H265).
1 parent fbd14e0 commit 1da0ab0

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ VideoDECODEAV1::~VideoDECODEAV1()
148148
{
149149
if (m_is_init)
150150
{
151-
Close();
151+
try { Close(); } catch (...) {}
152152
}
153153
}
154154

_studio/mfx_lib/decode/h264/src/mfx_h264_dec_decode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ VideoDECODEH264::VideoDECODEH264(VideoCORE *core, mfxStatus * sts)
205205

206206
VideoDECODEH264::~VideoDECODEH264(void)
207207
{
208-
Close();
208+
try { Close(); } catch (...) {}
209209
}
210210

211211
mfxStatus VideoDECODEH264::Init(mfxVideoParam *par)

_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ VideoDECODEH265::VideoDECODEH265(VideoCORE *core, mfxStatus * sts)
138138

139139
VideoDECODEH265::~VideoDECODEH265(void)
140140
{
141-
Close();
141+
try { Close(); } catch (...) {}
142142
}
143143

144144
// Initialize decoder instance

0 commit comments

Comments
 (0)