소스 검색

Fix compare logic.

Miku AuahDark 5 년 전
부모
커밋
87e1955bcf
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/modules/sound/SoundData.cpp

+ 2 - 2
src/modules/sound/SoundData.cpp

@@ -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;
 	
 	// Check range
-	if (dstStart < 0 || (dstStart+count) * bytesPerSample >= size)
+	if (dstStart < 0 || (dstStart+count) * bytesPerSample > size)
 		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!");
 
 	if (bitDepth != src->bitDepth)