Add patch fix-XPM.patch (upstream fix for #1217178).

This commit is contained in:
Hubbitus 2015-11-21 20:15:18 +03:00
parent da4cdb6e83
commit c6e35d1ec2
2 changed files with 29 additions and 1 deletions

View File

@ -3,7 +3,7 @@
Name: ImageMagick
Version: %{VER}.%{Patchlevel}
Release: 0.beta.3%{?dist}.2
Release: 0.beta.4%{?dist}
Summary: An X application for displaying and manipulating images
Group: Applications/Multimedia
License: ImageMagick
@ -23,6 +23,8 @@ BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
BuildRequires: jbigkit-devel
BuildRequires: openjpeg2-devel >= 2.1.0
Patch0: fix-XPM.patch
%description
ImageMagick is an image display and manipulation tool for the X
Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF,
@ -134,6 +136,9 @@ however.
%prep
%setup -q -n %{name}-%{VER}-%{Patchlevel}
%patch0 -p0 -b .xpm-fix
sed -i 's/libltdl.la/libltdl.so/g' configure
iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
touch -r README.txt README.txt.tmp
@ -324,6 +329,9 @@ rm -rf %{buildroot}
%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
%changelog
* Sat Nov 21 2015 Pavel Alexeev <Pahan@Hubbitus.info> - 6.9.1.3-0.beta.4
- Add patch fix-XPM.patch (upstream fix for #1217178).
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.9.1.3-0.beta.3.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

20
fix-XPM.patch Normal file
View File

@ -0,0 +1,20 @@
--- magick/colormap.c.orig 2014-12-25 21:05:34.000000000 +0300
+++ magick/colormap.c 2015-11-21 16:06:49.632335362 +0300
@@ -112,7 +112,7 @@
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- image->colors=MagickMax(colors,2);
+ image->colors=MagickMax(colors,1);
if (image->colormap == (PixelPacket *) NULL)
image->colormap=(PixelPacket *) AcquireQuantumMemory(image->colors,
sizeof(*image->colormap));
@@ -131,7 +131,7 @@
size_t
pixel;
- pixel=(size_t) (i*(QuantumRange/(image->colors-1)));
+ pixel=(size_t) (i*(QuantumRange/MagickMax(colors-1,1)));
image->colormap[i].red=(Quantum) pixel;
image->colormap[i].green=(Quantum) pixel;
image->colormap[i].blue=(Quantum) pixel;