drawinglayer/source/processor2d/cairopixelprocessor2d.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit ee98538e8eee8d481a1c7247e652871fb3d1ef8e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Aug 28 13:13:17 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Aug 28 15:11:42 2025 +0200

    crashtesting ooo57177-1.doc
    
    regression from
        commit c2fedef548f2822cf2a7e7b3ff928d389ce25728
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Wed Aug 6 20:35:05 2025 +0200
        BitmapEx->Bitmap in Graphic
    
    the problem here, is that we are now allocating a single 32-bit bitmap 
instead
    of a 24-bit bitmap and an 8-bit bitmap.
    
    The crashtesting file has an image of size 17000 x 17000, which hits the
    
         size > SAL_MAX_INT32/2
    
    check in ImplCreateDIB the svp backend.
    
    Change-Id: Ic76eb03adeedcfbb7d60e78405641035e3eb7087
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190323
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
index d60d7d3a2d4b..955caedf06b0 100644
--- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
@@ -1168,6 +1168,11 @@ Bitmap CairoPixelProcessor2D::extractBitmap() const
     const bool bHasAlpha(CAIRO_FORMAT_ARGB32 == aFormat);
     Bitmap aBitmap(aBitmapSize, bHasAlpha ? vcl::PixelFormat::N32_BPP : 
vcl::PixelFormat::N24_BPP);
     BitmapWriteAccess aAccess(aBitmap);
+    if (!aAccess)
+    {
+        SAL_WARN("drawinglayer", "Could not create image, likely too large, 
size= " << aBitmapSize);
+        return aRetval;
+    }
 
     // prepare cairo stuff
     const sal_uInt32 nStride(cairo_image_surface_get_stride(pReadSource));

Reply via email to