Fix TarsInput, fix #1998

This commit is contained in:
Him188 2022-05-02 09:59:44 +01:00
parent 7a6c7a89c0
commit ed37609731

View File

@ -78,7 +78,12 @@ internal class TarsInput(
if (input.endOfInput) {
return null
}
val var2 = input.readUByte()
val var2 = try {
input.readUByte()
} catch (e: EOFException) {
// somehow `endOfInput` still returns false
return null
}
val type = var2 and 15u
var tag = var2.toUInt() shr 4
if (tag == 15u) {