mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-07 15:31:11 +00:00
- fixed crash on NAM.
This game contains one sound that made the Voc loader crash.
This commit is contained in:
parent
dd984c94b0
commit
4050ce156f
1 changed files with 4 additions and 3 deletions
|
@ -392,7 +392,7 @@ std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int le
|
||||||
switch (blocktype)
|
switch (blocktype)
|
||||||
{
|
{
|
||||||
case 1: // Sound data
|
case 1: // Sound data
|
||||||
if (noextra && (codec == -1 || codec == sfxdata[i+1]))
|
if (/*noextra &*/ (codec == -1 || codec == sfxdata[i + 1])) // NAM contains a VOC where a valid data block follows an extra block.
|
||||||
{
|
{
|
||||||
frequency = 1000000 / (256 - sfxdata[i]);
|
frequency = 1000000 / (256 - sfxdata[i]);
|
||||||
channels = 1;
|
channels = 1;
|
||||||
|
@ -404,6 +404,7 @@ std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int le
|
||||||
else okay = false;
|
else okay = false;
|
||||||
len += blocksize - 2;
|
len += blocksize - 2;
|
||||||
}
|
}
|
||||||
|
else okay = false;
|
||||||
break;
|
break;
|
||||||
case 2: // Sound data continuation
|
case 2: // Sound data continuation
|
||||||
if (codec == -1)
|
if (codec == -1)
|
||||||
|
|
Loading…
Reference in a new issue