mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Viewer - crash with zero size virtual file (issue #2373)
(cherry picked from commit 66d9f04d01)
This commit is contained in:
parent
b204fbb617
commit
6776fac0e4
1 changed files with 6 additions and 1 deletions
|
|
@ -1644,7 +1644,12 @@ begin
|
|||
begin
|
||||
FMappedFile := GetMem(MaxMemSize - 1);
|
||||
FFileSize := FileRead(FFileHandle, FMappedFile^, MaxMemSize - 1);
|
||||
Result := (FFileSize > 0);
|
||||
Result := (FFileSize >= 0);
|
||||
if not Result then
|
||||
begin
|
||||
FLastError := mbSysErrorMessage;
|
||||
FreeMemAndNil(FMappedFile);
|
||||
end;
|
||||
FileClose(FFileHandle);
|
||||
FFileHandle := 0;
|
||||
Exit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue