AppServer: check for NULL bitmap.

Consistently check for NULL the ServerBitmap pointer.
There seems to be cases where BView::DragMessage could pass an invalid
Bitmap token to app_server.
Maybe it's when a client only bitmap is passed, I don't know.
Anyway, this is defensive programming, and at least we check for NULL
consistently now.
This fixes #11681.
Note that SuperFreeCell still crashes, but at least app_server doesn't crash.
This commit is contained in:
Stefano Ceccherini
2015-08-12 00:40:06 +02:00
parent f2de125b8c
commit a48ef9e817
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -612,7 +612,8 @@ EventDispatcher::SetDragMessage(BMessage& message,
if (fLastButtons == 0) {
// mouse buttons has already been released or was never pressed
bitmap->ReleaseReference();
if (bitmap != NULL)
bitmap->ReleaseReference();
return;
}
+2 -1
View File
@@ -2074,7 +2074,8 @@ fDesktop->UnlockSingleWindow();
fDesktop->EventDispatcher().SetDragMessage(dragMessage,
bitmap, offset);
fDesktop->LockSingleWindow();
bitmap->ReleaseReference();
if (bitmap != NULL)
bitmap->ReleaseReference();
}
delete[] buffer;
}