File 0001-Fix-crash-bug-with-bad-GIFs-Issue-423.patch of Package htmldoc.17396
From f50aab7c7642467f2e7afbf7f04e186b30eeb1b9 Mon Sep 17 00:00:00 2001 From: Michael R Sweet <michael.r.sweet@gmail.com> Date: Wed, 31 Mar 2021 20:18:00 -0400 Subject: [PATCH] Fix crash bug with bad GIFs (Issue #423) --- htmldoc/image.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htmldoc/image.cxx b/htmldoc/image.cxx index 5d29542..28777de 100644 --- a/htmldoc/image.cxx +++ b/htmldoc/image.cxx @@ -1271,6 +1271,9 @@ image_load_gif(image_t *img, /* I - Image pointer */ img->height = (buf[9] << 8) | buf[8]; ncolors = 2 << (buf[10] & 0x07); + if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767) + return (-1); + // If we are writing an encrypted PDF file, bump the use count so we create // an image object (Acrobat 6 bug workaround) if (Encryption) -- 2.31.1