From 60e14d32a5be0f286271921cb4a3014a6db1595e Mon Sep 17 00:00:00 2001 From: Trevor Spiteri Date: Tue, 15 Jan 2019 18:59:12 +0100 Subject: out-of-bounds access on Enter-up-left in new text field Reproduce using: 1. Select text tool (F8) 2. Click on empty canvas 3. Hit Enter 4. Hit Up 5. Hit Left --- src/libnrtype/Layout-TNG-OutIter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/Layout-TNG-OutIter.cpp b/src/libnrtype/Layout-TNG-OutIter.cpp index 761d58245..1c20ac30b 100644 --- a/src/libnrtype/Layout-TNG-OutIter.cpp +++ b/src/libnrtype/Layout-TNG-OutIter.cpp @@ -503,7 +503,7 @@ void Layout::queryCursorShape(iterator const &it, Geom::Point &position, double if (it._glyph_index == -1) { rotation = 0.0; } else if(it._glyph_index == 0) { - rotation = _glyphs[0].rotation; + rotation = _glyphs.empty() ? 0.0 : _glyphs[0].rotation; } else{ rotation = _glyphs[it._glyph_index - 1].rotation; } -- cgit v1.2.3