Browse Source

Fixing buffer position change after reading

It seems that only place where we use the buffer for appending is ASCII buffer in SCP code, where ForceLen is true, so the bug would not happen - as Len == Result.

(cherry picked from commit 5eb38fd14de04322e5e6af47bcf7a7d696eb4ce7)

Source commit: 1055dfdd97c171d05036d288428955e3dfe222ae
Martin Prikryl 5 years ago
parent
commit
8f1bf14ff2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      source/core/FileBuffer.cpp

+ 1 - 1
source/core/FileBuffer.cpp

@@ -79,7 +79,7 @@ DWORD __fastcall TFileBuffer::ReadStream(TStream * Stream, const DWORD Len, bool
     {
       Size = Size - Len + Result;
     }
-    FMemory->Seek(Len, soCurrent);
+    FMemory->Seek(Result, soCurrent);
   }
   catch(EReadError &)
   {