Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 663b538

Browse files
[[ Bug 13145 ]] ImageData display by reference hangs 7DP9
1 parent f91ae3b commit 663b538

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

docs/notes/bugfix-13145.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ImageData display by reference hangs 7DP9

engine/src/dskw32.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,16 @@ struct MCStdioFileHandle: public MCSystemFileHandle
15251525
return false;
15261526
}
15271527

1528+
// SN-2014-08-11: [[ Bug 13145 ]] If ReadFile can't read more, but no error is triggered, we should stop here,
1529+
// but return true. The new imageLoader reads buffer by buffer, and doesn't expect and error when reading the
1530+
// the last buffer (which might ask for more than remaining in the file).
1531+
if (nread == 0 && GetLastError() == 0)
1532+
{
1533+
r_read = t_offset;
1534+
m_is_eof = true;
1535+
return true;
1536+
}
1537+
15281538
t_remaining -= nread;
15291539
}
15301540
nread = t_offset;

0 commit comments

Comments
 (0)