Skip to content

Commit 862f76c

Browse files
authored
Fix a bug with MPEG parsing that would lead to range exceptions (lavalink-devs#31)
turns out dividing by smaller values yields larger quotients i have failed basic math
1 parent e4ff34f commit 862f76c

File tree

1 file changed

+1
-1
lines changed
  • main/src/main/java/com/sedmelluq/discord/lavaplayer/natives/mp3

1 file changed

+1
-1
lines changed

main/src/main/java/com/sedmelluq/discord/lavaplayer/natives/mp3/Mp3Decoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public static MpegVersion getVersion(byte[] buffer, int offset) {
179179

180180
private static int getMaxFrameSize() {
181181
int bitRate = MPEG_1.bitrateIndex[MPEG_1.bitrateIndex.length - 1] * 1000;
182-
int sampleRate = MPEG_1.samplerateIndex[1];
182+
int sampleRate = MPEG_1.samplerateIndex[2];
183183
return MPEG_1.calculateFrameSize(bitRate, sampleRate, true);
184184
}
185185

0 commit comments

Comments
 (0)