[Scummvm-cvs-logs] scummvm master -> de78651a5d327ade8febe6f0585b841f1f0eff43
csnover
csnover at users.noreply.github.com
Mon May 30 15:36:38 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
de78651a5d SCI32: Really guard against null pointer dereference in calcLists
Commit: de78651a5d327ade8febe6f0585b841f1f0eff43
https://github.com/scummvm/scummvm/commit/de78651a5d327ade8febe6f0585b841f1f0eff43
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-05-30T08:35:53-05:00
Commit Message:
SCI32: Really guard against null pointer dereference in calcLists
CID 1356125.
Changed paths:
engines/sci/graphics/frameout.cpp
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 64ae828..009ae28 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);
More information about the Scummvm-git-logs
mailing list