From 720455325086e08bc9fdcd822d713480d0c2e0a0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 17 Sep 2019 22:48:56 +0300 Subject: [PATCH] Ensure Text always has at least one line Otherwise coords_to_geometry may access bogus data. --- source/text.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/text.cpp b/source/text.cpp index a3ed762..8673075 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -25,7 +25,14 @@ struct Text::CoordsToGeomData Text::Text(): style(0) -{ } +{ + Line line; + line.start = 0; + line.bytes = 0; + line.length = 0; + line.width = 0; + lines.push_back(line); +} Text::Text(const Style &s, const string &t): style(&s) -- 2.43.0