[FIRE-35962] Fix crashes when checking for corrupt sounds

master
Hecklezz 2025-10-19 17:59:03 +10:00
parent 3410a182c5
commit 42df6526a2
2 changed files with 4 additions and 4 deletions

View File

@ -660,7 +660,7 @@ bool LLAudioEngine::preloadSound(const LLUUID &uuid)
LL_DEBUGS("AudioEngine")<<"( "<<uuid<<" )"<<LL_ENDL; LL_DEBUGS("AudioEngine")<<"( "<<uuid<<" )"<<LL_ENDL;
// <FS:ND> Protect against corrupted sounds. Just do a quick exit instead of trying to preload over and over again. // <FS:ND> Protect against corrupted sounds. Just do a quick exit instead of trying to preload over and over again.
if( gAudiop->isCorruptSound( uuid ) ) if (gAudiop && gAudiop->isCorruptSound(uuid))
return false; return false;
// </FS:ND> // </FS:ND>
@ -1317,7 +1317,7 @@ std::map<LLUUID, LLSoundHistoryItem> gSoundHistory;
void LLAudioSource::logSoundPlay(const LLUUID& id, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped) void LLAudioSource::logSoundPlay(const LLUUID& id, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped)
{ {
// <FS:ND> Corrupt asset, do not bother // <FS:ND> Corrupt asset, do not bother
if( gAudiop->isCorruptSound( assetid ) ) if (gAudiop && gAudiop->isCorruptSound(assetid))
return; return;
// </FS:ND> // </FS:ND>

View File

@ -4889,7 +4889,7 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
msg->getUUIDFast(_PREHASH_DataBlock, _PREHASH_OwnerID, owner_id); msg->getUUIDFast(_PREHASH_DataBlock, _PREHASH_OwnerID, owner_id);
// <FS:ND> Protect against corrupted sounds // <FS:ND> Protect against corrupted sounds
if (gAudiop->isCorruptSound(sound_id)) if (gAudiop && gAudiop->isCorruptSound(sound_id))
return; return;
// </FS:ND> // </FS:ND>
@ -4944,7 +4944,7 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data)
msg->getUUIDFast(_PREHASH_DataBlock, _PREHASH_OwnerID, owner_id); msg->getUUIDFast(_PREHASH_DataBlock, _PREHASH_OwnerID, owner_id);
// <FS:ND> Protect against corrupted sounds // <FS:ND> Protect against corrupted sounds
if (gAudiop->isCorruptSound(sound_id)) if (gAudiop && gAudiop->isCorruptSound(sound_id))
return; return;
// </FS:ND> // </FS:ND>