Skip to content

Commit

Permalink
Fix potential infinite loop in S_PaintChannels when playing sounds wi…
Browse files Browse the repository at this point in the history
…th loop start >= end (e.g. misc/forcefield.wav from Madfox's kaptlog.zip)
  • Loading branch information
andrei-drexler authored and sezero committed Jun 18, 2024
1 parent 0df3aeb commit 4f5354f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Quake/snd_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
else
info.samples = samples;

if (info.loopstart >= info.samples)
{
Con_Warning ("%s has loop start >= end\n", name);
info.loopstart = -1;
info.samples = samples;
}

info.dataofs = data_p - wav;

return info;
Expand Down

0 comments on commit 4f5354f

Please sign in to comment.