Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 1a336e6

Browse files
committed
FIx out of bound in __readData
1 parent c5918aa commit 1a336e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/funkin/backend/utils/AudioAnalyzer.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ final class AudioAnalyzer {
448448
}
449449

450450
inline function __readData(startPos:Float, endPos:Float, callback:AudioAnalyzerCallback) {
451-
var pos = Math.floor(startPos * __toBits), end = Math.floor(endPos * __toBits), c = 0;
451+
var pos = Math.floor(startPos * __toBits), end = Math.min(Math.floor(endPos * __toBits), buffer.data.buffer.length), c = 0;
452452
pos -= pos % __sampleSize;
453453
end -= end % __sampleSize;
454454

0 commit comments

Comments
 (0)