diff options
author | Zezula Ladislav <ladislav.zezula@avast.com> | 2017-08-29 15:08:20 +0200 |
---|---|---|
committer | Zezula Ladislav <ladislav.zezula@avast.com> | 2017-08-29 15:08:20 +0200 |
commit | 1ab0ad9c1869b070a3d4665758067dd539d292c2 (patch) | |
tree | 7f6aee726aef5ba5705a51945c5a3db4be5968f5 /src | |
parent | 431570180b0d089143c10b40563810bb45e57300 (diff) | |
parent | 0b72bdfa3a14c856b20ecf64d5a94cdaf03c2d1f (diff) |
Merge branch 'master' of https://github.com/ladislav-zezula/StormLib
Diffstat (limited to 'src')
-rw-r--r-- | src/SFileReadFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SFileReadFile.cpp b/src/SFileReadFile.cpp index 485b361..f91d2af 100644 --- a/src/SFileReadFile.cpp +++ b/src/SFileReadFile.cpp @@ -867,8 +867,8 @@ DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * plFilePosHi // If moving backward, don't allow the new position go negative if((LONGLONG)DeltaPos < 0) { - if(NewPosition > FileSize) - NewPosition = 0; + if(NewPosition > FileSize) // Position is negative + return SFILE_INVALID_POS; } // If moving forward, don't allow the new position go past the end of the file |