engine: client: soundlib: catch broken null.wav and replace it with silence

This commit is contained in:
Alibek Omarov
2026-05-10 03:02:24 +05:00
parent 9c4edaed21
commit 33b3cdb0f5

View File

@@ -344,6 +344,18 @@ qboolean Sound_LoadWAV( const char *name, const byte *buffer, fs_offset_t filesi
}
}
// silence known-broken WAVs that contain stray non-zero samples masquerading as silence
if( Q_stristr( name, "null.wav" ))
{
uint32_t crc;
CRC32_Init( &crc );
CRC32_ProcessBuffer( &crc, buffer, filesize );
crc = CRC32_Final( crc );
if( crc == 0x14a36f29 ) // common/null.wav (Half-Life)
memset( sound.wav, 0, sound.size );
}
return true;
}