gnu: imagemagick: Add more upstream fixes.

* gnu/packages/patches/imagemagick-ReadDCMImage-fix.patch,
gnu/packages/patches/imagemagick-ReadDCMPixels-fix.patch,
gnu/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/imagemagick.scm (source): Add patches.
This commit is contained in:
Mark H Weaver 2021-03-27 07:01:37 -04:00
parent bfc69d5e7c
commit 2d3d7faf0a
No known key found for this signature in database
GPG Key ID: 7CEF29847562C516
5 changed files with 93 additions and 1 deletions

View File

@ -1221,6 +1221,9 @@ dist_patch_DATA = \
%D%/packages/patches/idris-disable-test.patch \
%D%/packages/patches/ilmbase-fix-tests.patch \
%D%/packages/patches/imagemagick-CVE-2020-27829.patch \
%D%/packages/patches/imagemagick-ReadDCMImage-fix.patch \
%D%/packages/patches/imagemagick-ReadDCMPixels-fix.patch \
%D%/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch \
%D%/packages/patches/inetutils-hurd.patch \
%D%/packages/patches/inkscape-poppler-0.76.patch \
%D%/packages/patches/intel-xed-fix-nondeterminism.patch \

View File

@ -157,7 +157,10 @@ text, lines, polygons, ellipses and Bézier curves.")
(base32
"1pkwij76yz7vd5grl6520pgpa912qb6kh34qamx4zfndwcx6cf6b"))
(patches
(search-patches "imagemagick-CVE-2020-27829.patch"))))))
(search-patches "imagemagick-ReadDCMImage-fix.patch"
"imagemagick-ReadDCMPixels-fix.patch"
"imagemagick-WriteTHUMBNAILImage-fix.patch"
"imagemagick-CVE-2020-27829.patch"))))))
(define-public perl-image-magick
(package

View File

@ -0,0 +1,26 @@
From 512668dfd92b20d0d08b91d62b422d8262573281 Mon Sep 17 00:00:00 2001
From: Dirk Lemstra <dirk@lemstra.org>
Date: Wed, 24 Mar 2021 20:37:15 +0100
Subject: [PATCH] Throw exception when no exception was raised but status was
false (#3432).
---
coders/dcm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/coders/dcm.c b/coders/dcm.c
index 7a68ed6e8..ed17c9567 100644
--- a/coders/dcm.c
+++ b/coders/dcm.c
@@ -3989,6 +3989,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
if (redmap != (int *) NULL)
redmap=(int *) RelinquishMagickMemory(redmap);
image=DestroyImageList(image);
+ if ((status == MagickFalse) && (exception->severity < ErrorException))
+ ThrowReaderException(CorruptImageError,"CorruptImage");
return(GetFirstImageInList(images));
}
if (info.depth != (1UL*MAGICKCORE_QUANTUM_DEPTH))
--
2.31.0

View File

@ -0,0 +1,35 @@
From c8f25953ad1dd38a8b2d92738f0f742ad7e0bce7 Mon Sep 17 00:00:00 2001
From: Cristy <mikayla-grace@urban-warrior.org>
Date: Sun, 21 Mar 2021 21:21:15 -0400
Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32322
---
coders/dcm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/coders/dcm.c b/coders/dcm.c
index 29eed9618..7a68ed6e8 100644
--- a/coders/dcm.c
+++ b/coders/dcm.c
@@ -2984,12 +2984,12 @@ static MagickBooleanType ReadDCMPixels(Image *image,DCMInfo *info,
}
else
{
- SetPixelRed(q,(Quantum) (((ssize_t) pixel.red) |
- (((ssize_t) GetPixelRed(q)) << 8)));
- SetPixelGreen(q,(Quantum) (((ssize_t) pixel.green) |
- (((ssize_t) GetPixelGreen(q)) << 8)));
- SetPixelBlue(q,(Quantum) (((ssize_t) pixel.blue) |
- (((ssize_t) GetPixelBlue(q)) << 8)));
+ SetPixelRed(q,(Quantum) (((size_t) pixel.red) |
+ (((size_t) GetPixelRed(q)) << 8)));
+ SetPixelGreen(q,(Quantum) (((size_t) pixel.green) |
+ (((size_t) GetPixelGreen(q)) << 8)));
+ SetPixelBlue(q,(Quantum) (((size_t) pixel.blue) |
+ (((size_t) GetPixelBlue(q)) << 8)));
}
q++;
}
--
2.31.0

View File

@ -0,0 +1,25 @@
From 6a5d3575487487f2703383338bd17c8c25068f19 Mon Sep 17 00:00:00 2001
From: Cristy <mikayla-grace@urban-warrior.org>
Date: Thu, 25 Mar 2021 08:58:18 -0400
Subject: [PATCH] eliminate compiler warning
---
coders/thumbnail.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/coders/thumbnail.c b/coders/thumbnail.c
index 3833341b0..1e2bfe8c2 100644
--- a/coders/thumbnail.c
+++ b/coders/thumbnail.c
@@ -199,7 +199,7 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info,
q++;
}
if ((q > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) ||
- (length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q)))
+ ((ssize_t) length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q)))
ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail");
thumbnail_image=BlobToImage(image_info,q,length,&image->exception);
if (thumbnail_image == (Image *) NULL)
--
2.31.0