1
0
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:
Anonymous Maarten 2018-08-07 12:36:46 +02:00
parent f85f6e3391
commit 99dca06dbc

View File

@ -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);