textsplit: check for underflow while trimming the span
This commit is contained in:
parent
3726999684
commit
1a753c8c4a
1 changed files with 2 additions and 1 deletions
|
@ -390,7 +390,8 @@ inline bool TextSplit::doemit(bool spanerase, int bp)
|
|||
case '_':
|
||||
case '\'':
|
||||
m_span.resize(m_span.length()-1);
|
||||
if (m_words_in_span.back().second > m_span.size())
|
||||
if (m_words_in_span.size() &&
|
||||
m_words_in_span.back().second > m_span.size())
|
||||
m_words_in_span.back().second = m_span.size();
|
||||
if (--bp < 0)
|
||||
bp = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue