vcl: return earlier if size is empty

Change-Id: I96bcd47d93e0e4d05e33d3ad3eca86c6edcf87ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165950
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2024-04-10 16:20:09 +02:00
parent fe66cf8c80
commit e1f3120ce8

View File

@@ -376,6 +376,12 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
::basegfx::B2DRectangle const & rDestRect,
::basegfx::B2DHomMatrix const & rLocalTransform )
{
const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ),
::basegfx::fround( rDestRect.getHeight() ) );
if( aDestBmpSize.IsEmpty() )
return BitmapEx();
const Size aBmpSize( rBitmap.GetSizePixel() );
Bitmap aSrcBitmap( rBitmap.GetBitmap() );
Bitmap aSrcAlpha;
@@ -416,12 +422,6 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
}
// else: mapping table is not used
const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ),
::basegfx::fround( rDestRect.getHeight() ) );
if( aDestBmpSize.IsEmpty() )
return BitmapEx();
Bitmap aDstBitmap(aDestBmpSize, aSrcBitmap.getPixelFormat(), &pReadAccess->GetPalette());
Bitmap aDstAlpha( AlphaMask( aDestBmpSize ).GetBitmap() );