From: Mikko Rasa Date: Tue, 17 Sep 2019 19:48:56 +0000 (+0300) Subject: Ensure Text always has at least one line X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=commitdiff_plain;h=720455325086e08bc9fdcd822d713480d0c2e0a0 Ensure Text always has at least one line Otherwise coords_to_geometry may access bogus data. --- 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)