aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorColin Snover2016-05-30 08:33:38 -0500
committerColin Snover2016-05-30 08:35:53 -0500
commitde78651a5d327ade8febe6f0585b841f1f0eff43 (patch)
tree74ff4c5b15fd78c4a4778627703776158973a73e /engines/sci/graphics
parentd2497f710f38b449f59b5d648339e8ffa47bb8e2 (diff)
downloadscummvm-rg350-de78651a5d327ade8febe6f0585b841f1f0eff43.tar.gz
scummvm-rg350-de78651a5d327ade8febe6f0585b841f1f0eff43.tar.bz2
scummvm-rg350-de78651a5d327ade8febe6f0585b841f1f0eff43.zip
SCI32: Really guard against null pointer dereference in calcLists
CID 1356125.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/frameout.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 64ae828a50..009ae2818e 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -667,6 +667,10 @@ void GfxFrameout::calcLists(ScreenItemListList &drawLists, EraseListList &eraseL
--outerPlane->_priorityChanged;
Plane *visibleOuterPlane = _visiblePlanes.findByObject(outerPlane->_object);
+ if (visibleOuterPlane == nullptr) {
+ warning("calcLists could not find visible plane for %04x:%04x", PRINT_REG(outerPlane->_object));
+ continue;
+ }
rectlist.add(outerPlane->_screenRect.findIntersectingRect(visibleOuterPlane->_screenRect));
@@ -680,7 +684,7 @@ void GfxFrameout::calcLists(ScreenItemListList &drawLists, EraseListList &eraseL
int splitCount = splitRects(*rectlist[rectIndex], _planes[innerIndex]->_screenRect, outRects);
if (splitCount == 0) {
- if (visibleInnerPlane != nullptr && visibleOuterPlane != nullptr) {
+ if (visibleInnerPlane != nullptr) {
// same priority, or relative priority between inner/outer changed
if ((visibleOuterPlane->_priority - visibleInnerPlane->_priority) * (outerPlane->_priority - innerPlane->_priority) <= 0) {
if (outerPlane->_priority <= innerPlane->_priority) {
@@ -697,7 +701,7 @@ void GfxFrameout::calcLists(ScreenItemListList &drawLists, EraseListList &eraseL
rectlist.add(outRects[i]);
}
- if (visibleInnerPlane != nullptr && visibleOuterPlane != nullptr) {
+ if (visibleInnerPlane != nullptr) {
// same priority, or relative priority between inner/outer changed
if ((visibleOuterPlane->_priority - visibleInnerPlane->_priority) * (outerPlane->_priority - innerPlane->_priority) <= 0) {
*rectlist[rectIndex] = outerPlane->_screenRect.findIntersectingRect(innerPlane->_screenRect);