Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5405,9 +5405,19 @@ void Drawable::xfer(Xfer* xfer)
{
if (!customizedToSilence)
{
AsciiString baseInfoName = m_customSoundAmbientInfo->getOriginalName();
xfer->xferAsciiString(&baseInfoName);
m_customSoundAmbientInfo->xferNoName(xfer);
// Guard against dangling or invalid pointer before dereferencing
if (m_customSoundAmbientInfo != NULL)
{
AsciiString baseInfoName = m_customSoundAmbientInfo->getOriginalName();
xfer->xferAsciiString(&baseInfoName);
m_customSoundAmbientInfo->xferNoName(xfer);
}
else
{
DEBUG_CRASH(("Drawable::xfer - m_customSoundAmbientInfo is NULL during save but customized flag is set; skipping custom ambient sound save"));
AsciiString emptyName;
xfer->xferAsciiString(&emptyName);
}
}
}
}
Expand Down
Loading