From 17835c5af459d8f2a2cd7e6429073ae106d8b918 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 6 Aug 2024 02:19:21 +0000 Subject: automatic import of libX11 --- ...lip-images-to-maximum-height-width-allowe.patch | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 0002-XPutImage-clip-images-to-maximum-height-width-allowe.patch (limited to '0002-XPutImage-clip-images-to-maximum-height-width-allowe.patch') diff --git a/0002-XPutImage-clip-images-to-maximum-height-width-allowe.patch b/0002-XPutImage-clip-images-to-maximum-height-width-allowe.patch new file mode 100644 index 0000000..27b5912 --- /dev/null +++ b/0002-XPutImage-clip-images-to-maximum-height-width-allowe.patch @@ -0,0 +1,41 @@ +From 73a37d5f2fcadd6540159b432a70d80f442ddf4a Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Thu, 7 Sep 2023 15:55:04 -0700 +Subject: [PATCH 2/3] XPutImage: clip images to maximum height & width allowed + by protocol + +The PutImage request specifies height & width of the image as CARD16 +(unsigned 16-bit integer), same as the maximum dimensions of an X11 +Drawable, which the image is being copied to. + +Signed-off-by: Alan Coopersmith +--- + src/PutImage.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/PutImage.c b/src/PutImage.c +index a6db7b42..ba411e36 100644 +--- a/src/PutImage.c ++++ b/src/PutImage.c +@@ -30,6 +30,7 @@ in this Software without prior written authorization from The Open Group. + #include "Xlibint.h" + #include "Xutil.h" + #include ++#include + #include "Cr.h" + #include "ImUtil.h" + #include "reallocarray.h" +@@ -962,6 +963,10 @@ XPutImage ( + height = image->height - req_yoffset; + if ((width <= 0) || (height <= 0)) + return 0; ++ if (width > USHRT_MAX) ++ width = USHRT_MAX; ++ if (height > USHRT_MAX) ++ height = USHRT_MAX; + + if ((image->bits_per_pixel == 1) || (image->format != ZPixmap)) { + dest_bits_per_pixel = 1; +-- +2.41.0 + -- cgit v1.2.3