Skip to content

Commit

Permalink
RadialShadingContext: Fix crash due to NPE when matrix determinant is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ediweissmann committed Dec 21, 2024
1 parent c16a69c commit 5dced7c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ public RadialShadingContext(PDShadingType3 shading, ColorModel colorModel,
}
catch (NoninvertibleTransformException ex)
{
LOG.error(ex.getMessage() + ", matrix: " + matrix, ex);
LOG.error(ex.getMessage(), ex);
LOG.warn(ex.getMessage() + ", matrix: " + matrix + ", using fallback to identity transform with a minimal scale to avoid singularity");
// Fallback to identity transform with a minimal scale to avoid singularity
rat = new AffineTransform();
rat.scale(1e-6, 1e-6);
}

// shading space -> device space
Expand Down

0 comments on commit 5dced7c

Please sign in to comment.