commit 86aef1960f5cc909cdebf87463898357e9e3a848
parent 2919eedad7fb090ab06d57e7837c84defaa2e00a
Author: Frederic Cambus <fred@statdns.com>
Date: Wed, 31 Oct 2018 23:01:06 +0100
The colors[] array is not initialized if we use CED mode, so don't attempt to read from it
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c
@@ -500,16 +500,16 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
column = ansi_buffer[loop].column;
row = ansi_buffer[loop].row;
- if (background < 16)
- background = colors[background];
-
- if (foreground < 16)
- foreground = colors[foreground];
-
if (ced) {
drawchar(canvas, fontData.font_data, options->bits, fontData.height,
column, row, ced_background, ced_foreground, character);
} else {
+ if (background < 16)
+ background = colors[background];
+
+ if (foreground < 16)
+ foreground = colors[foreground];
+
drawchar(canvas, fontData.font_data, options->bits, fontData.height,
column, row, background, foreground, character);
}