libansilove

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

commit 4f7e5621a77f6474eb6a31d1e63003fcd1b908bf
parent 9be5347a481fb9b0e58ee8161d9ec33316657d76
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 13 Sep 2019 09:02:03 +0200

Return ANSILOVE_FORMAT_ERROR if xbin_fontsize > 32.

The eXtended BIN Format specification mention that any other values than
1 to 32 should be considered illegal.

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

diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -54,6 +54,11 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) xbin_fontsize = 16; } + if (xbin_fontsize > 32) { + ctx->error = ANSILOVE_FORMAT_ERROR; + return -1; + } + gdImagePtr canvas; canvas = gdImageCreate(8 * xbin_width, xbin_fontsize * xbin_height);