diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/file.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/file.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp index 49e6e1716d..a602cb4503 100644 --- a/engines/sci/engine/file.cpp +++ b/engines/sci/engine/file.cpp @@ -129,7 +129,7 @@ reg_t file_open(EngineState *s, const Common::String &filename, int mode, bool u } FileHandle *getFileFromHandle(EngineState *s, uint handle) { - if (handle == 0 || handle >= VIRTUALFILE_HANDLE_START) { + if ((handle == 0) || ((handle >= VIRTUALFILE_HANDLE_START) && (handle <= VIRTUALFILE_HANDLE_END))) { error("Attempt to use invalid file handle (%d)", handle); return 0; } diff --git a/engines/sci/engine/file.h b/engines/sci/engine/file.h index f43958c5ab..54627d5228 100644 --- a/engines/sci/engine/file.h +++ b/engines/sci/engine/file.h @@ -45,6 +45,7 @@ enum { #define VIRTUALFILE_HANDLE_SCI32SAVE 32100 #define PHANTASMAGORIA_SAVEGAME_INDEX "phantsg.dir" #define VIRTUALFILE_HANDLE_SCIAUDIO 32300 +#define VIRTUALFILE_HANDLE_END 32300 struct SavegameDesc { int16 id; |