]> git.saurik.com Git - wxWidgets.git/commitdiff
no real changes, just attempt to work around false coverity report 130
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 15:46:32 +0000 (15:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 15:46:32 +0000 (15:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/bitmap.cpp

index 73406ad376239effef892768b8d5febcadb07051..2af78decca5f1d4caf8047979cdb6e2841cfb3e4 100644 (file)
@@ -593,10 +593,11 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
 
         M_BMPDATA->m_pixmap = XCreatePixmap( xdisplay, xroot, width, height, depth );
 
-        // Create mask
+        // Create mask if necessary
+        const bool hasMask = image.HasMask();
 
         XImage *mask_image = (XImage*) NULL;
-        if (image.HasMask())
+        if ( hasMask )
         {
             mask_image = XCreateImage( xdisplay, xvisual, 1, ZPixmap, 0, 0, width, height, 32, 0 );
             mask_image->data = (char*) malloc( mask_image->bytes_per_line * mask_image->height );
@@ -646,8 +647,6 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
         unsigned char *colorCube =
             wxTheApp->GetVisualInfo(M_BMPDATA->m_display)->m_colorCube;
 
-        bool hasMask = image.HasMask();
-
         int index = 0;
         for (int y = 0; y < height; y++)
         {