vcl/source/bitmap/BitmapTools.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e1f3120ce83c113d7dc91b60f50344f63f1c41f0
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Apr 10 16:20:09 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Apr 10 17:42:03 2024 +0200

    vcl: return earlier if size is empty
    
    Change-Id: I96bcd47d93e0e4d05e33d3ad3eca86c6edcf87ac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165950
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/source/bitmap/BitmapTools.cxx 
b/vcl/source/bitmap/BitmapTools.cxx
index ee0134a90010..2330483bb98b 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -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() );
 

Reply via email to