mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-15 06:52:34 +02:00
rwengine: avoid crash of rwviewer/rwgmae when rendering incomplete color string
The string "~g" would crash rwviewer.
This commit is contained in:
parent
f85f6e3391
commit
99dca06dbc
@ -214,7 +214,7 @@ void TextRenderer::renderText(const TextRenderer::TextInfo& ti,
|
||||
char16_t c = text[i];
|
||||
|
||||
// Handle any markup changes.
|
||||
if (c == '~' && text.length() > i + 1) {
|
||||
if (c == '~' && text.length() > i + 2) {
|
||||
switch (text[i + 1]) {
|
||||
case 'b': // Blue
|
||||
text.erase(text.begin() + i, text.begin() + i + 3);
|
||||
|
Loading…
Reference in New Issue
Block a user