mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Error if getting/setting out-of-range samples (issue #674)
This commit is contained in:
@@ -161,7 +161,7 @@ void SoundData::setSample(int i, float sample)
|
||||
{
|
||||
// Check range.
|
||||
if (i < 0 || i >= size/(bits/8))
|
||||
return;
|
||||
throw love::Exception("Attempt to set out-of-range sample!");
|
||||
|
||||
if (bits == 16)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ float SoundData::getSample(int i) const
|
||||
{
|
||||
// Check range.
|
||||
if (i < 0 || i >= size/(bits/8))
|
||||
return 0;
|
||||
throw love::Exception("Attempt to get out-of-range sample!");
|
||||
|
||||
if (bits == 16)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user