aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2013-02-02 23:09:29 +0100
committerTorbjörn Andersson2013-02-02 23:09:29 +0100
commitb889bb69efee53327039d492b05cdc8cf20ea769 (patch)
tree45ffc7166a154e35b5a6218db8b72094a5925460 /engines
parent8f300bdc303579e4becc1d8e68bd8774042501b6 (diff)
downloadscummvm-rg350-b889bb69efee53327039d492b05cdc8cf20ea769.tar.gz
scummvm-rg350-b889bb69efee53327039d492b05cdc8cf20ea769.tar.bz2
scummvm-rg350-b889bb69efee53327039d492b05cdc8cf20ea769.zip
HOPKINS: Fix Valgrind warnings in INILINK()
We can't read all the way to the end of the buffer, because the READ_BE_UINT24() function will, naturally, read a few bytes ahead.
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/objects.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 7f94c8d92c..4249a1880d 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -3138,7 +3138,7 @@ void ObjectsManager::INILINK(const Common::String &file) {
}
_vm->_linesManager.resetLines();
- for (size_t idx = 0; idx < nbytes; idx++) {
+ for (size_t idx = 0; idx < nbytes - 3; idx++) {
if (READ_BE_UINT24(&ptr[idx]) == MKTAG24('O', 'B', '2')) {
v16 = ptr + idx + 4;
v32 = 0;
@@ -3164,7 +3164,7 @@ void ObjectsManager::INILINK(const Common::String &file) {
}
if (!OBSSEUL) {
- for (size_t idx = 0; idx < nbytes; idx++) {
+ for (size_t idx = 0; idx < nbytes - 3; idx++) {
if (READ_BE_UINT24(&ptr[idx]) == MKTAG24('Z', 'O', '2')) {
v17 = &ptr[idx + 4];
v33 = 0;