aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-28 16:47:30 +0000
committerFilippos Karapetis2010-05-28 16:47:30 +0000
commit5d21ff280a30347362701ee177ab54f85e18e712 (patch)
tree245cc4d68259c85027fa877652c1df02f48d6f7e /engines/sci
parent5b12fda0596b8b05768cc073b681d61c1493cf8e (diff)
downloadscummvm-rg350-5d21ff280a30347362701ee177ab54f85e18e712.tar.gz
scummvm-rg350-5d21ff280a30347362701ee177ab54f85e18e712.tar.bz2
scummvm-rg350-5d21ff280a30347362701ee177ab54f85e18e712.zip
Silenced some superfluous warnings in KQ5CD
svn-id: r49294
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kmisc.cpp7
-rw-r--r--engines/sci/graphics/paint16.cpp3
2 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index c05a2bc57b..68dc2fbba4 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -252,10 +252,15 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) {
break;
}
case K_MEMORY_PEEK : {
+ if (!argv[1].segment) {
+ // This occurs in KQ5CD when interacting with certain objects
+ warning("Attempt to peek invalid memory at %04x:%04x", PRINT_REG(argv[1]));
+ return s->r_acc;
+ }
+
SegmentRef ref = s->_segMan->dereference(argv[1]);
if (!ref.isValid() || ref.maxSize < 2) {
- // This occurs in KQ5CD when interacting with certain objects
warning("Attempt to peek invalid memory at %04x:%04x", PRINT_REG(argv[1]));
return s->r_acc;
}
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index a96189dbf0..ff4f3bec52 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -354,7 +354,8 @@ void GfxPaint16::bitsRestore(reg_t memoryHandle) {
}
void GfxPaint16::bitsFree(reg_t memoryHandle) {
- _segMan->freeHunkEntry(memoryHandle);
+ if (!memoryHandle.isNull()) // happens in KQ5CD
+ _segMan->freeHunkEntry(memoryHandle);
}
void GfxPaint16::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {