libansilove

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

commit 435133be3ee9a4e6a64cf0465adc1c8ff92cdf77
parent a33f5fd6eb293b676f5314434b0c81b44f34f658
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 21 Oct 2020 13:16:24 +0200

Add some file format integrity checks in the IceDraw loader.

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

diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -99,6 +99,11 @@ ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) /* RLE compressed data */ idf_sequence_length = *cursor; + if (loop + 3 >= ctx->length) { + ctx->error = ANSILOVE_FORMAT_ERROR; + goto error; + } + while (idf_sequence_length--) { /* reallocate IDF buffer memory */