Skip to content

Commit a0ca310

Browse files
committed
Clamp the parameter to Mix_ReserveChannels() to positive values
Fixes #417 (cherry picked from commit 3ec4fee)
1 parent 6b682a2 commit a0ca310

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mixer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,8 @@ void Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel))
10511051
*/
10521052
int Mix_ReserveChannels(int num)
10531053
{
1054+
if (num < 0)
1055+
num = 0;
10541056
if (num > num_channels)
10551057
num = num_channels;
10561058
reserved_channels = num;

0 commit comments

Comments
 (0)