From 559af1159b485fa1b7361514976da2e0b5e87194 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 22 Mar 2022 15:17:58 +0100 Subject: [PATCH] [csharp] Minor bugfix of binary 3.8 version fallback reading logic. --- spine-csharp/src/SkeletonBinary.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spine-csharp/src/SkeletonBinary.cs b/spine-csharp/src/SkeletonBinary.cs index b24068643..a4e32116c 100644 --- a/spine-csharp/src/SkeletonBinary.cs +++ b/spine-csharp/src/SkeletonBinary.cs @@ -1200,7 +1200,7 @@ namespace Spine { input.Position = initialPosition; return GetVersionStringOld3X(); } 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"); } } @@ -1212,13 +1212,13 @@ namespace Spine { // Version. byteCount = ReadInt(true); - if (byteCount > 1) { + if (byteCount > 1 && byteCount <= 13) { byteCount--; var buffer = new byte[byteCount]; ReadFully(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."); } } }