forked from sezero/quakespasm
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential infinite loop in S_PaintChannels
when playing sounds with loop start >= end (e.g. misc/forcefield.wav from Madfox's kaptlog.zip)
- Loading branch information
1 parent
b444798
commit 3f41b0d
Showing
1 changed file
with
6 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,6 +345,12 @@ 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; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andrei-drexler
Author
Owner
|
||
} | ||
|
||
info.dataofs = data_p - wav; | ||
|
||
return info; | ||
|
Shouldn't we set
info.samples = samples;
here? Otherwise, info.samples still stays the value read from the file relying on loopstart being valid. Or am I missing something?