aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/script_v72he.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index ab11381e31..8f68dcc986 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -1618,8 +1618,10 @@ int ScummEngine_v72he::readFileToArray(int slot, int32 size) {
size = _hFileTable[slot].size() - _hFileTable[slot].pos();
writeVar(0, 0);
-
ArrayHeader *ah = defineArray(0, kByteArray, 0, 0, 0, size);
+
+ size = (FROM_LE_32(ah->dim1end) - FROM_LE_32(ah->dim1start) + 1) *
+ (FROM_LE_32(ah->dim2end) - FROM_LE_32(ah->dim2start) + 1);
_hFileTable[slot].read(ah->data, size);
return readVar(0);