mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fix compare logic.
This commit is contained in:
@@ -267,9 +267,9 @@ void SoundData::copyFrom(const SoundData *src, int srcStart, int count, int dstS
|
|||||||
size_t srcBytesPerSample = (size_t) src->channels * src->bitDepth/8;
|
size_t srcBytesPerSample = (size_t) src->channels * src->bitDepth/8;
|
||||||
|
|
||||||
// Check range
|
// Check range
|
||||||
if (dstStart < 0 || (dstStart+count) * bytesPerSample >= size)
|
if (dstStart < 0 || (dstStart+count) * bytesPerSample > size)
|
||||||
throw love::Exception("Destination out-of-range!");
|
throw love::Exception("Destination out-of-range!");
|
||||||
if (srcStart < 0 || (srcStart+count) * srcBytesPerSample >= src->size)
|
if (srcStart < 0 || (srcStart+count) * srcBytesPerSample > src->size)
|
||||||
throw love::Exception("Source out-of-range!");
|
throw love::Exception("Source out-of-range!");
|
||||||
|
|
||||||
if (bitDepth != src->bitDepth)
|
if (bitDepth != src->bitDepth)
|
||||||
|
|||||||
Reference in New Issue
Block a user