summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-07-24 14:20:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-07-26 08:40:38 +0200
commitcfbdbfdc9964f77b447a2b200398b3ab00cec1d7 (patch)
tree86a1a19f7640de0685378576201af5af3908be2c /drawinglayer
parentca3ddcf2cb8a7b69131a310621be18d044122a1c (diff)
Be careful not to add empty rect representation to contour polypolygon
The implementation of TextSimplePortionPrimitive2D::getB2DRange in drawinglayer/source/primitive2d/textprimitive2d.cxx can return an empty B2DRange (which is represented internally as a huge square with DBL_MIN/MAX coordindates) and adding that to maExtractedContour would later cause > include/tools/helpers.hxx:76:44: runtime error: 1.79769e+308 is outside the range of representable values of type 'long' > #0 in FRound(double) at include/tools/helpers.hxx:76:44 > #1 in ImplPolygon::ImplPolygon(basegfx::B2DPolygon const&) at tools/source/generic/poly.cxx:474:30 > #2 in tools::Polygon::Polygon(basegfx::B2DPolygon const&) at tools/source/generic/poly.cxx:1849:72 > #3 in TextRanger::TextRanger(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const*, unsigned short, unsigned short, unsigned short, bool, bool, bool) at editeng/source/misc/txtrange.cxx:67:40 > #4 in std::_MakeUniq<TextRanger>::__single_object std::make_unique<TextRanger, basegfx::B2DPolyPolygon&, basegfx::B2DPolyPolygon*, int, unsigned short, unsigned short, bool, bool, bool>(basegfx::B2DPolyPolygon&, basegfx::B2DPolyPolygon*&&, int&&, unsigned short&&, unsigned short&&, bool&&, bool&&, bool&&) at /home/sbergman/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/10.0.0/../../../../include/c++/10.0.0/bits/unique_ptr.h:930:34 > #5 in SwContourCache::ContourRect(SwFormat const*, SdrObject const*, SwTextFrame const*, SwRect const&, long, bool) at sw/source/core/text/txtfly.cxx:252:13 when processing such a DBL_MAX = 1.79769e+308 coordinate while loading doc/ooo106646-2.doc (i.e., 3sem-program-electricity_and_magnetism.doc attached at <https://bz.apache.org/ooo/show_bug.cgi?id=106646#c13>). Change-Id: I7bcdf7fdb3a756d7fab0543697efeb8f92ceddb7 Reviewed-on: https://gerrit.libreoffice.org/76261 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/contourextractor2d.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 7e730bd2293e..5961cef14115 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -176,8 +176,11 @@ namespace drawinglayer
{
// primitives who's BoundRect will be added in world coordinates
basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
- aRange.transform(getViewInformation2D().getObjectTransformation());
- maExtractedContour.emplace_back(basegfx::utils::createPolygonFromRect(aRange));
+ if (!aRange.isEmpty())
+ {
+ aRange.transform(getViewInformation2D().getObjectTransformation());
+ maExtractedContour.emplace_back(basegfx::utils::createPolygonFromRect(aRange));
+ }
break;
}
default :