CID 1761 : Dereferencing a potentially NULL pointer.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37953 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-08-07 16:57:23 +00:00
parent 456d57afb2
commit e015add185
+8 -3
View File
@@ -133,9 +133,14 @@ Utility::MakeScreenshot(bool includeMouse, bool activeWindow,
if (wholeScreen == NULL)
return NULL;
BRect bounds = cursorBitmap->Bounds();
int cursorWidth = bounds.IntegerWidth() + 1;
int cursorHeight = bounds.IntegerHeight() + 1;
int cursorWidth = 0;
int cursorHeight = 0;
if (cursorBitmap != NULL) {
BRect bounds = cursorBitmap->Bounds();
cursorWidth = bounds.IntegerWidth() + 1;
cursorHeight = bounds.IntegerHeight() + 1;
}
if (includeMouse && cursorBitmap != NULL) {
// Import the cursor bitmap into wholeScreen