]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/bitmap.cpp
Applied patch [ 1447666 ] Fix obscure GTK wxListBox construction bug
[wxWidgets.git] / src / gtk / bitmap.cpp
index 05ffe3b3d3863222a2b277b884463783cf669c25..cb358da34a5ddfef0f123431535cd47055acf920 100644 (file)
@@ -455,7 +455,7 @@ wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight,
                     old_x = x;
                 }
 
-                if (bpp == 1)
+                if ( dst )
                 {
                     if (!pixval)
                     {
@@ -480,14 +480,14 @@ wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight,
             }
 
             // do not forget the last byte
-            if ((bpp == 1) && (width % 8 != 0))
+            if ( dst && (width % 8 != 0) )
                 dst[h*dstbyteperline+width/8] = outbyte;
         }
 
         gdk_image_destroy( img );
         if (gc) gdk_gc_unref( gc );
 
-        if (bpp == 1)
+        if ( dst )
         {
             bmp = wxBitmap( (const char *)dst, width, height, 1 );
             free( dst );