Skip to content

Commit 472ccab

Browse files
yuanwadegfxVPLsdm
authored andcommitted
[Decode] Fix m_dst memory leak in VideoDECODEMJPEGBase_HW::Close()
At the start of each frame, m_dst is allocated to hold the decoded JPEG data. After a successful decode, it is moved into m_dsts. Close() iterates m_dsts and frees every entry. However, if the application stops mid-frame (e.g. hits a frame-count limit), m_dst has been allocated but not yet transferred into m_dsts. Close() skips it, leaving the allocation dangling. The Debug CRT detects this leak on DLL unload and calls abort(), producing STATUS_FATAL_APP_EXIT (exit code -1073740767 / 0xC0000421). Add explicit delete[] m_dst; m_dst = nullptr; in Close() to cover this path.
1 parent f8df816 commit 472ccab

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

_studio/mfx_lib/decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,9 @@ mfxStatus VideoDECODEMJPEGBase_HW::Close(void)
15581558
}
15591559
}
15601560

1561+
delete[] m_dst;
1562+
m_dst = nullptr;
1563+
15611564
memset(&m_stat, 0, sizeof(mfxDecodeStat));
15621565

15631566
m_va = 0;

0 commit comments

Comments
 (0)