Skip to content

Commit

Permalink
Fix potential infinite loop in S_PaintChannels
Browse files Browse the repository at this point in the history
when playing sounds with loop start >= end
(e.g. misc/forcefield.wav from Madfox's kaptlog.zip)
  • Loading branch information
andrei-drexler committed Jun 18, 2024
1 parent b444798 commit 68dc185
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 @@ -345,6 +345,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

1 comment on commit 68dc185

@sezero
Copy link

@sezero sezero commented on 68dc185 Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will be applying to QS shortly (and to uhexen2, too.) Thanks.

CC: @j0zzz : this is the last iteration of b20c27b

Please sign in to comment.