aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2009-12-31 00:06:28 +0000
committerSven Hesse2009-12-31 00:06:28 +0000
commit5c52ed9f4be95fb68267139a6e329112f234ef2e (patch)
treee062f9730de67f3384ac781b0d1cd4dd435a4437 /engines/gob
parent9c430b5298dbd4fcb49fdf1e0ec2460448d4a11a (diff)
downloadscummvm-rg350-5c52ed9f4be95fb68267139a6e329112f234ef2e.tar.gz
scummvm-rg350-5c52ed9f4be95fb68267139a6e329112f234ef2e.tar.bz2
scummvm-rg350-5c52ed9f4be95fb68267139a6e329112f234ef2e.zip
Make sure that enough data is read out of the script
svn-id: r46785
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/script.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp
index 0475bb06f7..e27ecda968 100644
--- a/engines/gob/script.cpp
+++ b/engines/gob/script.cpp
@@ -155,9 +155,11 @@ byte *Script::getData() {
}
byte Script::readByte() {
- byte v;
+ byte v = 0;
+ uint32 n;
- read(&v, 1);
+ n = read(&v, 1);
+ assert(n == 1);
return v;
}
@@ -171,17 +173,21 @@ uint8 Script::readUint8() {
}
uint16 Script::readUint16() {
- byte v[2];
+ byte v[2] = {0, 0};
+ uint32 n;
- read(v, 2);
+ n = read(v, 2);
+ assert(n == 2);
return READ_LE_UINT16(v);
}
uint32 Script::readUint32() {
- byte v[4];
+ byte v[4] = {0, 0, 0, 0};
+ uint32 n;
- read(v, 4);
+ n = read(v, 4);
+ assert(n == 4);
return READ_LE_UINT32(v);
}