From 39183627438a2f050ef5b2d5e49cbc6eb0fd47da Mon Sep 17 00:00:00 2001 From: Wizou Date: Sat, 18 Sep 2021 02:30:12 +0200 Subject: [PATCH] Fix "Non-negative number" issue with large bytes fields --- src/TL.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TL.cs b/src/TL.cs index 5f0d60b..19dbd4d 100644 --- a/src/TL.cs +++ b/src/TL.cs @@ -204,7 +204,7 @@ namespace TL bytes = reader.ReadBytes(length); else { - length = reader.ReadInt16() + (reader.ReadByte() << 16); + length = reader.ReadUInt16() + (reader.ReadByte() << 16); bytes = reader.ReadBytes(length); length += 3; }