Ticket #9890: 0013-Fix-called-C-object-pointer-is-null.patch

File 0013-Fix-called-C-object-pointer-is-null.patch, 1.5 KB (added by mt, 6 years ago)

Patch

  • src/servers/app/drawing/interface/remote/RemoteDrawingEngine.cpp

    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, 
    10941094            bitmaps[i] = new(std::nothrow) UtilityBitmap(
    10951095                BRect(0, 0, targetWidth - 1, targetHeight - 1),
    10961096                bitmap.ColorSpace(), 0);
    1097             if (bitmaps[i] == NULL)
     1097            if (bitmaps[i] == NULL) {
    10981098                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            }
    11051109        }
    11061110
    11071111        if (result != B_OK) {