mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +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)
|
||||
{
|
||||
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;
|
||||
codec = sfxdata[i+1];
|
||||
codec = sfxdata[i + 1];
|
||||
if (codec == 0)
|
||||
bits = 8;
|
||||
else if (codec == 4)
|
||||
|
@ -404,6 +404,7 @@ std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int le
|
|||
else okay = false;
|
||||
len += blocksize - 2;
|
||||
}
|
||||
else okay = false;
|
||||
break;
|
||||
case 2: // Sound data continuation
|
||||
if (codec == -1)
|
||||
|
|
Loading…
Reference in a new issue