diff options
Diffstat (limited to 'engines/sci/engine/kfile.cpp')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index af438bdaff..b1f85227c1 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -812,7 +812,8 @@ reg_t kFileIOReadRaw(EngineState *s, int argc, reg_t *argv) { FileHandle *f = getFileFromHandle(s, handle); if (f) { bytesRead = f->_in->read(buf, size); - s->_segMan->memcpy(argv[1], (const byte*)buf, size); + if (bytesRead > 0) + s->_segMan->memcpy(argv[1], (const byte*)buf, size); } delete[] buf; |