drawinglayer/source/primitive2d/primitivetools2d.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cb9b24e522c727cc6b89443afa9cf85824614524
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Oct 24 14:04:56 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Oct 24 19:29:12 2025 +0200

    tdf#147025 float-divide-by-zero in calculateStepsForSvgGradient
    
    we appear to be trying to render a very small object
    here, which results in a zero fDiscreteUnit being
    calculated in DiscreteMetricDependentPrimitive2D::get2DDecomposition.
    
    Just return a nullptr (i.e. empty output) for that case.
    
    Change-Id: I6fd576cb886799831986931cd77d3416133a81d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192938
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx 
b/drawinglayer/source/primitive2d/primitivetools2d.cxx
index cf98fd9b26c0..27263b2f2a82 100644
--- a/drawinglayer/source/primitive2d/primitivetools2d.cxx
+++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx
@@ -29,6 +29,8 @@ namespace drawinglayer::primitive2d
             // get the current DiscreteUnit, look at X and Y and use the 
maximum
             const basegfx::B2DVector 
aDiscreteVector(rViewInformation.getInverseObjectToViewTransformation() * 
basegfx::B2DVector(1.0, 1.0));
             const double fDiscreteUnit(std::min(fabs(aDiscreteVector.getX()), 
fabs(aDiscreteVector.getY())));
+            if(basegfx::fTools::equalZero(fDiscreteUnit))
+                return;
 
             if(hasBuffered2DDecomposition() && 
!basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit()))
             {

Reply via email to