aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/kfile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 75844f4b38..bdad29efe7 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -753,6 +753,10 @@ reg_t kFileIO(EngineState *s, int argc, reg_t *argv) {
Common::String name = s->segMan->getString(argv[1]);
int mode = argv[2].toUint16();
+ if (name.empty()) {
+ warning("Attempted to open a file with an empty filename");
+ return make_reg(0, SIGNAL_OFFSET);
+ }
file_open(s, name.c_str(), mode);
debug(3, "K_FILEIO_OPEN(%s,0x%x)", name.c_str(), mode);
break;