Fix some minor KEYCONV and VOC memory issues

This commit is contained in:
Kevin Caccamo 2024-04-20 01:40:54 -04:00 committed by Christoph Oelckers
parent 06eee55671
commit c03b272062
2 changed files with 4 additions and 5 deletions

View file

@ -749,9 +749,8 @@ sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx)
{
auto sfxp = sfxdata.data();
int32_t dmxlen = LittleLong(((int32_t *)sfxp)[1]);
// If the sound is voc, use the custom loader.
if (memcmp (sfxp, "Creative Voice File", 19) == 0)
if (size > 19 && memcmp (sfxp, "Creative Voice File", 19) == 0)
{
sfx->data = GSnd->LoadSoundVoc(sfxp, size);
}

View file

@ -171,7 +171,7 @@ void D_LoadWadSettings ()
while (conf < eof)
{
size_t i;
size_t i = 0;
// Fetch a line to execute
command.Clear();
@ -179,14 +179,14 @@ void D_LoadWadSettings ()
{
command.Push(conf[i]);
}
if (i == 0)
if (i == 0) // Blank line
{
conf++;
continue;
}
command.Push(0);
conf += i;
if (*conf == '\n')
if (conf >= eof || *conf == '\n')
{
conf++;
}