fix possible crashes while parsing hitsounds (see itdelatrisu/opsu#422)
This commit is contained in:
@@ -240,7 +240,7 @@ public class HitObject {
|
|||||||
String[] edgeHitSoundTokens = tokens[8].split("\\|");
|
String[] edgeHitSoundTokens = tokens[8].split("\\|");
|
||||||
this.edgeHitSound = new byte[edgeHitSoundTokens.length];
|
this.edgeHitSound = new byte[edgeHitSoundTokens.length];
|
||||||
for (int j = 0; j < edgeHitSoundTokens.length; j++)
|
for (int j = 0; j < edgeHitSoundTokens.length; j++)
|
||||||
edgeHitSound[j] = Byte.parseByte(edgeHitSoundTokens[j]);
|
edgeHitSound[j] = (byte) Short.parseShort(edgeHitSoundTokens[j]);
|
||||||
}
|
}
|
||||||
if (tokens.length > 9) {
|
if (tokens.length > 9) {
|
||||||
String[] edgeAdditionTokens = tokens[9].split("\\|");
|
String[] edgeAdditionTokens = tokens[9].split("\\|");
|
||||||
|
|||||||
Reference in New Issue
Block a user