]> git.saurik.com Git - wxWidgets.git/commitdiff
test for dst!=NULL instead of bpp==1 in Rescale() as otherwise we'd crash on monochro...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:52:46 +0000 (23:52 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:52:46 +0000 (23:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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 );