aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-12 18:24:37 +0000
committerMartin Kiewitz2010-01-12 18:24:37 +0000
commit52eb58a3e558a34b03c69ec5b4a60a5e6a1b9b41 (patch)
tree18ac3710fe3c942272eb2710bbc8f210c026d89e
parente4aed638b020a019dd6989541bd125cc93eb26c1 (diff)
downloadscummvm-rg350-52eb58a3e558a34b03c69ec5b4a60a5e6a1b9b41.tar.gz
scummvm-rg350-52eb58a3e558a34b03c69ec5b4a60a5e6a1b9b41.tar.bz2
scummvm-rg350-52eb58a3e558a34b03c69ec5b4a60a5e6a1b9b41.zip
SCI: View::getCelCount now validates input
svn-id: r47267
-rw-r--r--engines/sci/graphics/view.cpp6
-rw-r--r--engines/sci/graphics/view.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index ffa97adb62..e2bcc47ce5 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -507,6 +507,12 @@ void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectT
}
}
+uint16 View::getCelCount(int16 loopNo) {
+ if ((loopNo < 0) || (loopNo >= _loopCount))
+ return 0;
+ return _loop[loopNo].celCount;
+}
+
Palette *View::getPalette() {
return _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
}
diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h
index f339ca077e..8c01b380b9 100644
--- a/engines/sci/graphics/view.h
+++ b/engines/sci/graphics/view.h
@@ -62,7 +62,7 @@ public:
byte *getBitmap(int16 loopNo, int16 celNo);
void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires, uint16 scaleX = 128, uint16 scaleY = 128);
uint16 getLoopCount() const { return _loopCount; }
- uint16 getCelCount(int16 loopNo) { return _loop[loopNo].celCount; }
+ uint16 getCelCount(int16 loopNo);
Palette *getPalette();
private: