summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-04 20:36:24 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-05 01:09:18 +0200
commit21e0a2658a565b5359703670ad9a709b232a4a27 (patch)
tree5c418f6474fd0a4bf4dd58b1d24a84d7bd19779a
parente55074b33b1e3a2f630b74ae5de03a748b1624cd (diff)
crashtesting: assert with stroke width of 4.86057e+93
on import attempt of moz1322643-3.svg Change-Id: I5f18601767212c1eb7453aacbad076099a2a5b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167142 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 0253aa42e071..5da9ea7c4d3c 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -672,9 +672,15 @@ namespace svgio::svgreader
// get stroke width; SVG does not use 0.0 == hairline, so 0.0 is no line at all
const double fStrokeWidth(getStrokeWidth().isSet() ? getStrokeWidth().solve(mrOwner) : 1.0);
- if(!basegfx::fTools::more(fStrokeWidth, 0.0))
+ if (!basegfx::fTools::more(fStrokeWidth, 0.0))
return;
+ if (fStrokeWidth > std::numeric_limits<sal_Int32>::max())
+ {
+ SAL_WARN("svgio", "ignoring ludicrous stroke width: " << fStrokeWidth);
+ return;
+ }
+
drawinglayer::primitive2d::Primitive2DReference aNewLinePrimitive;
// if we have a line with two identical points it is not really a line,