From 31d34d447971f0a0e00154a0aded625082e04210 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Tue, 23 Jul 2013 19:40:43 +0900
Subject: [PATCH] Fix called C++ object pointer is null
---
.../interface/remote/RemoteDrawingEngine.cpp | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/servers/app/drawing/interface/remote/RemoteDrawingEngine.cpp b/src/servers/app/drawing/interface/remote/RemoteDrawingEngine.cpp
index 92442b0..a1cb441 100644
a
|
b
|
RemoteDrawingEngine::_ExtractBitmapRegions(ServerBitmap& bitmap, uint32 options,
|
1094 | 1094 | bitmaps[i] = new(std::nothrow) UtilityBitmap( |
1095 | 1095 | BRect(0, 0, targetWidth - 1, targetHeight - 1), |
1096 | 1096 | bitmap.ColorSpace(), 0); |
1097 | | if (bitmaps[i] == NULL) |
| 1097 | if (bitmaps[i] == NULL) { |
1098 | 1098 | result = B_NO_MEMORY; |
1099 | | |
1100 | | result = bitmaps[i]->ImportBits(bitmap.Bits(), bitmap.BitsLength(), |
1101 | | bitmap.BytesPerRow(), bitmap.ColorSpace(), sourceRect.LeftTop(), |
1102 | | BPoint(0, 0), targetWidth, targetHeight); |
1103 | | if (result != B_OK) |
1104 | | delete bitmaps[i]; |
| 1099 | } else { |
| 1100 | result = bitmaps[i]->ImportBits(bitmap.Bits(), |
| 1101 | bitmap.BitsLength(), bitmap.BytesPerRow(), |
| 1102 | bitmap.ColorSpace(), sourceRect.LeftTop(), |
| 1103 | BPoint(0, 0), targetWidth, targetHeight); |
| 1104 | if (result != B_OK) { |
| 1105 | delete bitmaps[i]; |
| 1106 | bitmaps[i] = NULL; |
| 1107 | } |
| 1108 | } |
1105 | 1109 | } |
1106 | 1110 | |
1107 | 1111 | if (result != B_OK) { |