diff --git a/UndertaleModLib/Util/BufferBinaryReader.cs b/UndertaleModLib/Util/BufferBinaryReader.cs index 17a12f3d9..f133739e5 100644 --- a/UndertaleModLib/Util/BufferBinaryReader.cs +++ b/UndertaleModLib/Util/BufferBinaryReader.cs @@ -286,7 +286,7 @@ public string ReadGMString() if (length < 0) throw new IOException("Invalid string length"); - if (chunkBuffer.Position + length + 1 >= _length) + if (chunkBuffer.Position + length + 1 > _length) throw new IOException("Reading out of chunk bounds"); string res; diff --git a/UndertaleModLib/Util/FileBinaryReader.cs b/UndertaleModLib/Util/FileBinaryReader.cs index 98db5e992..419ae9551 100644 --- a/UndertaleModLib/Util/FileBinaryReader.cs +++ b/UndertaleModLib/Util/FileBinaryReader.cs @@ -214,7 +214,7 @@ public string ReadGMString() if (length < 0) throw new IOException("Invalid string length"); - if (Stream.Position + length + 1 >= _length) + if (Stream.Position + length + 1 > _length) throw new IOException("Reading out of bounds"); string res;