Merge branch '4.0' into 4.1-beta

This commit is contained in:
Harald Csaszar 2022-03-22 15:22:06 +01:00
commit 5a95f90c67

View File

@ -1236,7 +1236,7 @@ namespace Spine {
input.Position = initialPosition; input.Position = initialPosition;
return GetVersionStringOld3X(); return GetVersionStringOld3X();
} catch (Exception e) { } catch (Exception e) {
throw new ArgumentException("Stream does not contain a valid binary Skeleton Data.\n" + e, "input"); throw new ArgumentException("Stream does not contain valid binary Skeleton Data.\n" + e, "input");
} }
} }
@ -1248,13 +1248,13 @@ namespace Spine {
// Version. // Version.
byteCount = ReadInt(true); byteCount = ReadInt(true);
if (byteCount > 1) { if (byteCount > 1 && byteCount <= 13) {
byteCount--; byteCount--;
var buffer = new byte[byteCount]; var buffer = new byte[byteCount];
ReadFully(buffer, 0, byteCount); ReadFully(buffer, 0, byteCount);
return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount); return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount);
} }
return null; throw new ArgumentException("Stream does not contain valid binary Skeleton Data.");
} }
} }
} }