Skip to content

Commit

Permalink
Don't crash if alSourcei(, AL_BUFFER, ) is passed a negative buffer n…
Browse files Browse the repository at this point in the history
…ame.
  • Loading branch information
icculus committed Apr 20, 2005
1 parent efe43e8 commit 71892d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osx/alSource.c
Expand Up @@ -440,7 +440,7 @@ ALAPI ALvoid ALAPIENTRY alSourcei (ALuint source, ALenum pname, ALint value)
{
// !!! FIXME: This is yucky. Use logic in alBuffer.c...
ALboolean valid = AL_FALSE;
valid = ( ((value - 1) < AL_MAXBUFFERS) &&
valid = ( (value > 0) && ((value - 1) < AL_MAXBUFFERS) &&
(ctx->buffers[value - 1].inUse) );

if (valid)
Expand Down

0 comments on commit 71892d7

Please sign in to comment.