From 9de7a9b3284b06631a47609a83e608cfe0541de1 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 14 Sep 2016 13:44:51 +0200 Subject: [PATCH] Merge branch 'quarkslab' --- src/fe-common/core/formats.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index ccf48394..d9a51201 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -131,6 +131,8 @@ void unformat_24bit_color(char **ptr, int off, int *fgcolor, int *bgcolor, int * unsigned char rgbx[4]; unsigned int i; for (i = 0; i < 4; ++i) { + if ((*ptr)[i + off] == '\0') + return; rgbx[i] = (*ptr)[i + off]; } rgbx[3] -= 0x20; @@ -1357,6 +1359,9 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text) bgcolor = *ptr==(char)0xff ? -1 : *ptr-'0'; } } + if (*ptr == '\0') + break; + ptr++; break; case 6: