summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorTrevor Spiteri <trevor.spiteri@um.edu.mt>2019-01-15 17:59:12 +0000
committerTrevor Spiteri <trevor.spiteri@um.edu.mt>2019-01-15 17:59:12 +0000
commit60e14d32a5be0f286271921cb4a3014a6db1595e (patch)
treea390b1970176a27d9585b146d4d08cea46245e6f /src/libnrtype
parentout-of-bounds access on Enter-up-down in new text field (diff)
downloadinkscape-60e14d32a5be0f286271921cb4a3014a6db1595e.tar.gz
inkscape-60e14d32a5be0f286271921cb4a3014a6db1595e.zip
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
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-OutIter.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}