test for dst!=NULL instead of bpp==1 in Rescale() as otherwise we'd crash on monochrome display (not very common any more, but still) (coverity checker CID 12)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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 );
|
||||
|
Reference in New Issue
Block a user