Files
shredos.x86_64/package/graphicsmagick/0001-ReadJXLImage-Apply-image-dimension-resource-limits.patch
2026-01-06 22:53:29 +00:00

33 lines
1.3 KiB
Diff

# HG changeset patch
# User Bob Friesenhahn <bfriesen@GraphicsMagick.org>
# Date 1725886903 18000
# Mon Sep 09 08:01:43 2024 -0500
# Node ID 9bbae7314e3c3b19b830591010ed90bb136b9c42
# Parent db3ff8d00c28c38895e1600a28706ce251dac570
ReadJXLImage(): Apply image dimension resource limits. Addresses oss-fuzz Issue 69728
Upstream: https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/9bbae7314e3c3b19b830591010ed90bb136b9c42
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[Peter: drop ChangeLog/version changes]
diff --git a/coders/jxl.c b/coders/jxl.c
--- a/coders/jxl.c
+++ b/coders/jxl.c
@@ -571,6 +571,7 @@
basic_info.alpha_bits, basic_info.num_color_channels,
basic_info.have_animation == JXL_FALSE ? "False" : "True");
}
+
if (basic_info.num_extra_channels)
{
size_t index;
@@ -637,6 +638,9 @@
image->orientation=convert_orientation(basic_info.orientation);
+ if (CheckImagePixelLimits(image, exception) != MagickPass)
+ ThrowJXLReaderException(ResourceLimitError,ImagePixelLimitExceeded,image);
+
pixel_format.endianness=JXL_NATIVE_ENDIAN;
pixel_format.align=0;
if (basic_info.num_color_channels == 1)