aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-07-23 03:00:02 +0200
committerThierry Crozat2018-01-23 00:00:12 +0000
commitaa447e81bc378ea327a2d3f943997416cd118039 (patch)
treed50b00d056070d33229036d72ebff505f9c6f5ad /engines/supernova
parent83523ebbdc837290e48f9b22f23ac2e83e1510a4 (diff)
downloadscummvm-rg350-aa447e81bc378ea327a2d3f943997416cd118039.tar.gz
scummvm-rg350-aa447e81bc378ea327a2d3f943997416cd118039.tar.bz2
scummvm-rg350-aa447e81bc378ea327a2d3f943997416cd118039.zip
SUPERNOVA: Initializes clickField.next with 0
It seems it is possible that some objects or subsequent click fields 'pointed' to by next are outside of the initialized range and are expected to be zeroed. This would explain the non-deterministic freezes I experienced.
Diffstat (limited to 'engines/supernova')
-rw-r--r--engines/supernova/graphics.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp
index d28c60118c..df3b706d10 100644
--- a/engines/supernova/graphics.cpp
+++ b/engines/supernova/graphics.cpp
@@ -98,6 +98,9 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) {
}
_numClickFields = stream.readByte();
+ for (int i = 0; i < kMaxClickFields; ++i) {
+ _clickField[i].next = 0;
+ }
for (int i = 0; i < _numClickFields; ++i) {
_clickField[i].x1 = stream.readUint16LE();
_clickField[i].x2 = stream.readUint16LE();