fix possible crashes while parsing hitsounds (see itdelatrisu/opsu#422)

This commit is contained in:
yugecin 2018-10-02 23:21:02 +02:00
parent 114f37841f
commit 54ce595c7f
No known key found for this signature in database
GPG Key ID: 2C5AC035A7068E44

View File

@ -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("\\|");