a potential double free fix .

This commit is contained in:
Zero Fanker 2024-10-20 16:14:56 -04:00
parent 2a9edd868c
commit 1672fd8901

View file

@ -1934,11 +1934,11 @@ void CLoading::SetImageData(unsigned char* pBuffer, const CString& NameInDict, i
void CLoading::SetImageData(unsigned char* pBuffer, PICDATA& pData, const int FullWidth, const int FullHeight, Palette* pPal, bool forceNoRemap)
{
if (pData.pic) {
delete[](pData.pic);
if (auto pPic = std::exchange(pData.pic, nullptr)) {
delete[](pPic);
}
if (pData.vborder) {
delete[](pData.vborder);
if (auto pBorder = std::exchange(pData.vborder, nullptr)) {
delete[](pBorder);
}
// Get available area