mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-07 07:21:10 +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,11 +392,11 @@ 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;
|
||||||
codec = sfxdata[i+1];
|
codec = sfxdata[i + 1];
|
||||||
if (codec == 0)
|
if (codec == 0)
|
||||||
bits = 8;
|
bits = 8;
|
||||||
else if (codec == 4)
|
else if (codec == 4)
|
||||||
|
@ -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