diff options
author | Colin Snover | 2016-05-27 18:59:12 -0500 |
---|---|---|
committer | Colin Snover | 2016-05-27 19:20:22 -0500 |
commit | 371b50e75abec89ed182a72599d96b645711bbc8 (patch) | |
tree | d69d2ae4c15b460e22d1979d884fbec25c39e577 /engines/sci/graphics/screen_item32.cpp | |
parent | 4840b889d7c8d2924f162c270d85c5431f0f86a6 (diff) | |
download | scummvm-rg350-371b50e75abec89ed182a72599d96b645711bbc8.tar.gz scummvm-rg350-371b50e75abec89ed182a72599d96b645711bbc8.tar.bz2 scummvm-rg350-371b50e75abec89ed182a72599d96b645711bbc8.zip |
SCI32: Add explicit checks for null pointers
CID 1351617, 1351618, 1351619, 1351620, 1351621, 1351622, 1354791.
Diffstat (limited to 'engines/sci/graphics/screen_item32.cpp')
-rw-r--r-- | engines/sci/graphics/screen_item32.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index 953091470f..fba0fa0422 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -326,6 +326,9 @@ void ScreenItem::calcRects(const Plane &plane) { mulinc(temp, celToScreenX, Ratio()); CelObjPic *celObjPic = dynamic_cast<CelObjPic *>(_celObj); + if (celObjPic == nullptr) { + error("Expected a CelObjPic"); + } temp.translate((celObjPic->_relativePosition.x * scriptToScreenX).toInt() - displaceX, 0); // TODO: This is weird. @@ -369,6 +372,9 @@ void ScreenItem::calcRects(const Plane &plane) { } CelObjPic *celObjPic = dynamic_cast<CelObjPic *>(_celObj); + if (celObjPic == nullptr) { + error("Expected a CelObjPic"); + } temp.translate(celObjPic->_relativePosition.x - (displaceX * scaleX).toInt(), celObjPic->_relativePosition.y - (celObj._displace.y * scaleY).toInt()); // TODO: This is weird. |