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:
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 */