Commit decb8fcb authored by Trevor Spiteri's avatar Trevor Spiteri Committed by Nathan Lee

out-of-bounds access on Enter-up-down in new text field

https://bugzilla.redhat.com/show_bug.cgi?id=1612618

Reproduce using:
1. Select text tool (F8)
2. Click on empty canvas
3. Hit Enter
4. Hit Up
5. Hit Down

Backport from 1.0alpha master
Cherry picked from 5ed5cde1
parent 8306201a
...@@ -788,7 +788,10 @@ bool Layout::iterator::nextLineCursor(int n) ...@@ -788,7 +788,10 @@ bool Layout::iterator::nextLineCursor(int n)
- _parent_layout->_chunks[_parent_layout->_spans[_parent_layout->_lineToSpan(line_index)].in_chunk].left_x; - _parent_layout->_chunks[_parent_layout->_spans[_parent_layout->_lineToSpan(line_index)].in_chunk].left_x;
} }
_char_index = _parent_layout->_cursorXOnLineToIterator(line_index + n, _x_coordinate)._char_index; _char_index = _parent_layout->_cursorXOnLineToIterator(line_index + n, _x_coordinate)._char_index;
_glyph_index = _parent_layout->_characters[_char_index].in_glyph; if (_char_index == _parent_layout->_characters.size())
_glyph_index = _parent_layout->_glyphs.size();
else
_glyph_index = _parent_layout->_characters[_char_index].in_glyph;
return true; return true;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment