[haiku-commits] haiku: hrev48715 - src/servers/app/drawing

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 23 Jan 2015 22:44:33 +0100 (CET)

hrev48715 adds 1 changeset to branch 'master'
old head: 86f6a66bbe1c03bb92aabffbb3e6b7e5144bb78f
new head: f6099728e419f4782cee75cc216178aa52be9492
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=f6099728e419+%5E86f6a66bbe1c

----------------------------------------------------------------------------

f6099728e419: Fix #11775.
  
  BitmapDrawingEngine:
  - Check if fBitmap is NULL before releasing its reference. Since this is
    the case when a BitmapDrawingEngine is instantiated, this would lead to
    an app_server crash upon any attempt to make use of one.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev48715
Commit:      f6099728e419f4782cee75cc216178aa52be9492
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f6099728e419
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Fri Jan 23 21:41:35 2015 UTC

Ticket:      https://dev.haiku-os.org/ticket/11775

----------------------------------------------------------------------------

1 file changed, 5 insertions(+), 3 deletions(-)
src/servers/app/drawing/BitmapDrawingEngine.cpp | 8 +++++---

----------------------------------------------------------------------------

diff --git a/src/servers/app/drawing/BitmapDrawingEngine.cpp 
b/src/servers/app/drawing/BitmapDrawingEngine.cpp
index 3f37fb1..7a9e0ef 100644
--- a/src/servers/app/drawing/BitmapDrawingEngine.cpp
+++ b/src/servers/app/drawing/BitmapDrawingEngine.cpp
@@ -48,7 +48,7 @@ BitmapDrawingEngine::SetSize(int32 newWidth, int32 newHeight)
        }
 
        SetHWInterface(NULL);
-       if (fHWInterface) {
+       if (fHWInterface != NULL) {
                fHWInterface->LockExclusiveAccess();
                fHWInterface->Shutdown();
                fHWInterface->UnlockExclusiveAccess();
@@ -56,8 +56,10 @@ BitmapDrawingEngine::SetSize(int32 newWidth, int32 newHeight)
                fHWInterface = NULL;
        }
 
-       fBitmap->ReleaseReference();
-       fBitmap = NULL;
+       if (fBitmap != NULL) {
+               fBitmap->ReleaseReference();
+               fBitmap = NULL;
+       }
 
        if (newWidth <= 0 || newHeight <= 0)
                return B_OK;


Other related posts:

  • » [haiku-commits] haiku: hrev48715 - src/servers/app/drawing - anevilyak