- fix crash issue with empty VOCs.

Pointer to empty data causes undefined behavior if length is 0.
This commit is contained in:
Christoph Oelckers 2021-07-25 12:43:42 +02:00
parent dfb18ef9a9
commit c69efe5817

View file

@ -450,7 +450,7 @@ SoundHandle SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int length)
}
// Second pass to write the data
if (okay)
if (okay && len > 0)
{
data = new uint8_t[len];
i = 26;