libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 9be5347a481fb9b0e58ee8161d9ec33316657d76
parent 548611fb1f10ec362f8ed374d0ac2a2edd6871e3
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 13 Sep 2019 08:57:06 +0200

Force xbin_fontsize to 16 when using default 80x25 font.

This fixes out-of-bounds read when calling drawchar with corrupted files
where xbin_fontsize is larger than 16.

Diffstat:
Msrc/loaders/xbin.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -114,6 +114,7 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) } else { /* using default 80x25 font */ font_data = font_pc_80x25; + xbin_fontsize = 16; } uint32_t column = 0, row = 0, foreground, background;