Hello community,

here is the log from the commit of package GraphicsMagick.12185 for 
openSUSE:Leap:15.1:Update checked in at 2020-03-31 00:20:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.1:Update/GraphicsMagick.12185 (Old)
 and      /work/SRC/openSUSE:Leap:15.1:Update/.GraphicsMagick.12185.new.3160 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "GraphicsMagick.12185"

Tue Mar 31 00:20:32 2020 rev:1 rq:788319 version:1.3.29

Changes:
--------
New Changes file:

--- /dev/null   2020-03-10 18:28:06.918142398 +0100
+++ 
/work/SRC/openSUSE:Leap:15.1:Update/.GraphicsMagick.12185.new.3160/GraphicsMagick.changes
   2020-03-31 00:20:35.438727622 +0200
@@ -0,0 +1,982 @@
+-------------------------------------------------------------------
+Wed Mar 25 13:55:57 UTC 2020 - [email protected]
+
+- security update
+- added patches
+  fix CVE-2019-12921 [bsc#1167208], the text filename component potentially 
allows to read arbitrary files via TranslateTextEx for SVG
+  + GraphicsMagick-CVE-2019-12921.patch
+  fix CVE-2020-10938 [bsc#1167623], integer overflow and resultant heap-based 
buffer overflow in HuffmanDecodeImage in magick/compress.c
+  + GraphicsMagick-CVE-2020-10938.patch
+
+-------------------------------------------------------------------
+Wed Jan  8 08:47:53 UTC 2020 - [email protected]
+
+- security update
+- added patches
+  CVE-2019-19951 [bsc#1160321]
+  + GraphicsMagick-CVE-2019-19951.patch
+  CVE-2019-19953 [bsc#1160364]
+  + GraphicsMagick-CVE-2019-19953.patch
+
+-------------------------------------------------------------------
+Fri Jan  3 13:07:20 UTC 2020 - [email protected]
+
+- security update
+- added patches
+  CVE-2019-19950 [bsc#1159852]
+  + GraphicsMagick-CVE-2019-19950.patch
+
+-------------------------------------------------------------------
+Tue Oct  8 10:06:46 UTC 2019 - [email protected]
+
+- security update
+- added patches
+  CVE-2019-16709 [bsc#1151782]
+  + GraphicsMagick-CVE-2019-16709.patch
+
+-------------------------------------------------------------------
+Tue Jun 18 14:49:00 UTC 2019 - [email protected]
+
+- security update
+- added patches
+  disable indirect reads (CVE-2019-12921) [bsc#1138425]
+  + GraphicsMagick-disable-indirect-reads.patch
+
+-------------------------------------------------------------------
+Tue May 28 09:06:44 UTC 2019 - [email protected]
+
+- disable also PCL [bsc#1136183]
+- modified patches
+  % GraphicsMagick-disable-insecure-coders.patch
+
+-------------------------------------------------------------------
+Tue Apr 30 11:16:51 UTC 2019 - [email protected]
+
+- security update
+- modified patches
+  CVE-2019-11008 [bsc#1132054], CVE-2019-11009 [bsc#1132053], CVE-2019-11473 
[bsc#1133203], CVE-2019-11474 [bsc#1133202]
+  % GraphicsMagick-xwd.c-update.patch (refreshed)
+- added patches
+  CVE-2019-11506 [bsc#1133498]
+  + GraphicsMagick-CVE-2019-11506.patch
+  CVE-2019-11505 [bsc#1133501]
+  + GraphicsMagick-CVE-2019-11505.patch
+
+-------------------------------------------------------------------
+Tue Apr 16 11:03:46 UTC 2019 - [email protected]
+
+- security update
+- added patches
+  CVE-2019-11005 [bsc#1132058]
+  + GraphicsMagick-CVE-2019-11005.patch
+  CVE-2019-11006 [bsc#1132061]
+  + GraphicsMagick-CVE-2019-11006.patch
+  CVE-2019-11010 [bsc#1132055]
+  + GraphicsMagick-CVE-2019-11010.patch
+  CVE-2019-11007 [bsc#1132060]
+  + GraphicsMagick-CVE-2019-11007.patch
+  CVE-2019-11008 [bsc#1132054], CVE-2019-11009 [bsc#1132053]
+  + GraphicsMagick-xwd.c-update.patch
+
+-------------------------------------------------------------------
+Mon Feb 11 18:28:37 UTC 2019 - Petr Gajdos <[email protected]>
+
+- security update (pdf.c):
+  * CVE-2019-7397 [bsc#1124366]
+    + GraphicsMagick-CVE-2019-7397.patch
+
+-------------------------------------------------------------------
+Fri Dec 21 10:51:09 UTC 2018 - Petr Gajdos <[email protected]>
+
+- security update (tga.c):
+  * CVE-2018-20184 [bsc#1119822]
+    + GraphicsMagick-CVE-2018-20184.patch
+
+-------------------------------------------------------------------
+Fri Dec 21 10:28:05 UTC 2018 - Petr Gajdos <[email protected]>
+
+- security update (dib.c):
+  * CVE-2018-20189 [bsc#1119790]
+    + GraphicsMagick-CVE-2018-20189.patch
+
+-------------------------------------------------------------------
+Thu Nov  1 09:48:32 UTC 2018 - Petr Gajdos <[email protected]>
+
+- security update (msl.c):
+  * CVE-2018-18544 [bsc#1113064]
+    + GraphicsMagick-CVE-2018-18544.patch
+
+-------------------------------------------------------------------
+Mon Oct 22 09:56:20 UTC 2018 - Petr Gajdos <[email protected]>
+
+- asan_build: build ASAN included
+- debug_build: build more suitable for debugging
+
+-------------------------------------------------------------------
+Mon Sep 10 10:23:02 UTC 2018 - Petr Gajdos <[email protected]>
+
+- security update (pict.c):
+  * CVE-2018-16644 [bsc#1107609]
+    + GraphicsMagick-CVE-2018-16644.patch
+
+-------------------------------------------------------------------
+Mon Sep 10 08:21:42 UTC 2018 - Petr Gajdos <[email protected]>
+
+- security update (bmp.c, dib.c):
+  * CVE-2018-16645 [bsc#1107604]
+    + GraphicsMagick-CVE-2018-16645.patch
+
+-------------------------------------------------------------------
+Wed Aug 22 13:46:48 UTC 2018 - [email protected]
+
+- disable PS, PS2, PS3 and PDF coders by default, remove gs calls 
+  from delegates.mgk
+  [bsc#1105592]
+
+-------------------------------------------------------------------
+Wed Jun 20 14:49:42 UTC 2018 - [email protected]
+
+- security update (rgb.c, cmyk.c, gray.c)
+  * CVE-2018-10805 and similar memory leaks [bsc#1095812]
+    + GraphicsMagick-CVE-2018-10805.patch
+
+-------------------------------------------------------------------
+Wed Jun 13 18:33:06 UTC 2018 - [email protected]
+
+- security update (dcm.c)
+  * fix invalid reads in dcm.c [bsc#1075821c#14]
+    GraphicsMagick-dcm.c-update.patch
+
+-------------------------------------------------------------------
+Wed May 23 08:34:17 UTC 2018 - [email protected]
+
+- update to 1.3.29:
+  * Security Fixes:
+    . GraphicsMagick is now participating in Google's oss-fuzz project 
+    . JNG: Require that the embedded JPEG image have the same dimensions
+      as the JNG image as provided by JHDR. Avoids a heap write overflow.
+    . MNG: Arbitrarily limit the number of loops which may be requested by
+      the MNG LOOP chunk to 512 loops, and provide the '-define
+      mng:maximum-loops=value' option in case the user wants to change the
+      limit.  This fixes a denial of service caused by large LOOP
+      specifications.
+  * Bug fixes:
+    . DICOM: Pre/post rescale functions are temporarily disabled (until
+      the implementation is fixed).
+    . JPEG: Fix regression in last release in which reading some JPEG
+      files produces the error "Improper call to JPEG library in state
+      201".
+    . ICON: Some DIB-based Windows ICON files were reported as corrupt to
+      an unexpectedly missing opacity mask image.
+    . In-memory Blob I/O: Don't implicitly increase the allocation size
+      due to seek offsets.
+    . MNG: Detect and handle failure to allocate global PLTE. Fix divide
+      by zero.
+    . DrawGetStrokeDashArray(): Check for failure to allocate memory.
+    . BlobToImage(): Now produces useful exception reports to cover the
+      cases where 'magick' was not set and the file format could not be
+      deduced from its header.
+  * API Updates:
+    . Wand API: Added MagickIsPaletteImage(), MagickIsOpaqueImage(),
+      MagickIsMonochromeImage(), MagickIsGrayImage(), MagickHasColormap()
+      based on contributions by Troy Patteson.
+    . New structure ImageExtra added and Image 'clip_mask' member is
+      replaced by 'extra' which points to private ImageExtra allocation.
+      The ImageGetClipMask() function now provides access to the clip mask
+      image.
+    . New structure DrawInfoExtra and DrawInfo 'clip_path' is replaced by
+      'extra' which points to private DrawInfoExtra allocation.  The
+      DrawInfoGetClipPath() function now provides access to the clip path.
+    . New core library functions: GetImageCompositeMask(),
+      CompositeMaskImage(), CompositePathImage(), SetImageCompositeMask(),
+      ImageGetClipMask(), ImageGetCompositeMask(), DrawInfoGetClipPath(),
+      DrawInfoGetCompositePath()
+    . Deprecated core library functions: RegisterStaticModules(),
+      UnregisterStaticModules().
+  * Feature improvements:
+    . Static modules (in static library or shared library without
++++ 785 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:Leap:15.1:Update/.GraphicsMagick.12185.new.3160/GraphicsMagick.changes

New:
----
  GraphicsMagick-1.3.29.tar.bz2
  GraphicsMagick-CVE-2018-10805.patch
  GraphicsMagick-CVE-2018-16644.patch
  GraphicsMagick-CVE-2018-16645.patch
  GraphicsMagick-CVE-2018-18544.patch
  GraphicsMagick-CVE-2018-20184.patch
  GraphicsMagick-CVE-2018-20189.patch
  GraphicsMagick-CVE-2019-11005.patch
  GraphicsMagick-CVE-2019-11006.patch
  GraphicsMagick-CVE-2019-11007.patch
  GraphicsMagick-CVE-2019-11010.patch
  GraphicsMagick-CVE-2019-11505.patch
  GraphicsMagick-CVE-2019-11506.patch
  GraphicsMagick-CVE-2019-12921.patch
  GraphicsMagick-CVE-2019-16709.patch
  GraphicsMagick-CVE-2019-19950.patch
  GraphicsMagick-CVE-2019-19951.patch
  GraphicsMagick-CVE-2019-19953.patch
  GraphicsMagick-CVE-2019-7397.patch
  GraphicsMagick-CVE-2020-10938.patch
  GraphicsMagick-dcm.c-update.patch
  GraphicsMagick-disable-indirect-reads.patch
  GraphicsMagick-disable-insecure-coders.patch
  GraphicsMagick-perl-linkage.patch
  GraphicsMagick-xwd.c-update.patch
  GraphicsMagick.changes
  GraphicsMagick.spec
  typemap

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ GraphicsMagick.spec ++++++
#
# spec file for package GraphicsMagick
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define asan_build    0
%define debug_build   0

%if 0%{?suse_version} >= 1315
%define bindperl 1
%else
%define bindperl 0
%endif
%define quant 16
%define base_version 1.3
%define so_ver          3
%define pp_so_ver       12
%define wand_so_ver     2
Name:           GraphicsMagick
Version:        1.3.29
Release:        0
Summary:        Viewer and Converter for Images
License:        MIT
Group:          Productivity/Graphics/Convertors
Url:            http://www.GraphicsMagick.org/
Source:         
ftp://ftp.GraphicsMagick.org/pub/%{name}/%{base_version}/%{name}-%{version}.tar.bz2
# following typemap file is needed for building PerlMagick with perl 5.16;
# should be present in Graphics Magick 1.4.0
%if %{bindperl}
Source1:        typemap
%endif
%if %{bindperl}
Patch0:         GraphicsMagick-perl-linkage.patch
Patch1:         GraphicsMagick-dcm.c-update.patch
Patch2:         GraphicsMagick-CVE-2018-10805.patch
Patch3:         GraphicsMagick-disable-insecure-coders.patch
Patch4:         GraphicsMagick-CVE-2018-16645.patch
Patch5:         GraphicsMagick-CVE-2018-16644.patch
Patch6:         GraphicsMagick-CVE-2018-18544.patch
Patch7:         GraphicsMagick-CVE-2018-20189.patch
Patch8:         GraphicsMagick-CVE-2018-20184.patch
Patch9:         GraphicsMagick-CVE-2019-7397.patch
# CVE-2019-11008 [bsc#1132054], CVE-2019-11009 [bsc#1132053], CVE-2019-11473 
[bsc#1133203], CVE-2019-11474 [bsc#1133202]
Patch10:         GraphicsMagick-xwd.c-update.patch
# CVE-2019-11007 [bsc#1132060]
Patch11:         GraphicsMagick-CVE-2019-11007.patch
# CVE-2019-11010 [bsc#1132055]
Patch12:         GraphicsMagick-CVE-2019-11010.patch
# CVE-2019-11006 [bsc#1132061]
Patch13:         GraphicsMagick-CVE-2019-11006.patch
# CVE-2019-11005 [bsc#1132058]
Patch14:         GraphicsMagick-CVE-2019-11005.patch
# CVE-2019-11505 [bsc#1133501]
Patch15:         GraphicsMagick-CVE-2019-11505.patch
# CVE-2019-11506 [bsc#1133498]
Patch16:         GraphicsMagick-CVE-2019-11506.patch
# disable indirect reads CVE-2019-12921 [bsc#1138425]
Patch17:         GraphicsMagick-disable-indirect-reads.patch
# CVE-2019-16709 [bsc#1151782]
Patch18:         GraphicsMagick-CVE-2019-16709.patch
# CVE-2019-19950 [bsc#1159852]
Patch19:         GraphicsMagick-CVE-2019-19950.patch
# CVE-2019-19951 [bsc#1160321]
Patch20:         GraphicsMagick-CVE-2019-19951.patch
# CVE-2019-19953 [bsc#1160364]
Patch21:         GraphicsMagick-CVE-2019-19953.patch
# CVE-2020-10938 [bsc#1167623], integer overflow and resultant heap-based 
buffer overflow in HuffmanDecodeImage in magick/compress.c
Patch22:         GraphicsMagick-CVE-2020-10938.patch
# CVE-2019-12921 [bsc#1167208], the text filename component potentially allows 
to read arbitrary files via TranslateTextEx for SVG
Patch23:         GraphicsMagick-CVE-2019-12921.patch
%endif
BuildRequires:  cups-client
BuildRequires:  dcraw
BuildRequires:  gcc-c++
BuildRequires:  ghostscript-fonts-other
BuildRequires:  ghostscript-fonts-std
BuildRequires:  ghostscript-library
BuildRequires:  libjasper-devel
%if 0%{?suse_version} >= 1315
BuildRequires:  libjbig-devel
BuildRequires:  libltdl-devel
%endif
BuildRequires:  libwmf-devel
%if 0%{?suse_version} >= 1315
BuildRequires:  libjpeg-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(lcms2)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(libwebp)
BuildRequires:  pkgconfig(libwebpmux)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(zlib)
%else
BuildRequires:  freetype2-devel
BuildRequires:  libbz2-devel
BuildRequires:  libtiff-devel
BuildRequires:  libxml-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%endif
Requires:       xorg-x11-fonts

%description
GraphicsMagick provides an image manipulation and translation
utility. It is capable of displaying still images and animations
using the X Window system which provides an interface for
interactively editing images, and is capable of importing selected
windows or the entire desktop. It can read and write over 88 image
formats, including JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD.
It also allows to resize, rotate, sharpen, color reduce, or add
special effects to an image and to save the result to any supported
format. GraphicsMagick may be used to create animated or transparent
.gifs, to composite images, and to create thumbnail images.

This package is compiled with Q%{quant}, which means that it provides better
performance on %{quant} bit images and less.

%package     -n libGraphicsMagick-Q%{quant}-%{so_ver}
Summary:        The GraphicsMagick image conversion runtime library
Group:          System/Libraries
Requires:       libGraphicsMagick3-config = %{version}

%description -n libGraphicsMagick-Q%{quant}-%{so_ver}
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

This package is compiled with Q%{quant}, that means it provides better
performance on %{quant} and less bit images.

%package     -n libGraphicsMagick%{so_ver}-config
Summary:        Configuration for the GraphicsMagick image conversion library
Group:          System/Libraries

%description -n libGraphicsMagick%{so_ver}-config
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

This package contains GraphicsMagick library configuration files.

%package     -n libGraphicsMagickWand-Q%{quant}-%{wand_so_ver}
Summary:        Runtime library for the GraphicsMagick image conversion library
Group:          System/Libraries

%description -n libGraphicsMagickWand-Q%{quant}-%{wand_so_ver}
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

This package is compiled with Q%{quant}, that means it provides better
performance on %{quant} and less bit images.

%package        devel
Summary:        Development files for the GraphicsMagick C language API
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libGraphicsMagick-Q%{quant}-%{so_ver} = %{version}
Requires:       libGraphicsMagickWand-Q%{quant}-%{wand_so_ver} = %{version}

%description    devel
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

%if %{bindperl}
%package     -n perl-GraphicsMagick
Summary:        Perl interface for the GraphicsMagick image conversion library
Group:          Development/Languages/Perl
Requires:       %{name} = %{version}
Requires:       perl = %{perl_version}

%description -n perl-GraphicsMagick
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

This package contains perl interface to GraphicsMagick library.
%endif

%package     -n libGraphicsMagick++-Q%{quant}-%{pp_so_ver}
Summary:        C++ interface for the GraphisMagick image conversion library
Group:          System/Libraries

%description -n libGraphicsMagick++-Q%{quant}-%{pp_so_ver}
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

This subpackage contains C++ interface to GraphicsMagick library.

%package     -n libGraphicsMagick++-devel
Summary:        Development files for the GraphicsMagick C++ language API
Group:          Development/Libraries/C and C++
Requires:       %{name}-devel = %{version}
Requires:       c++_compiler
Requires:       libGraphicsMagick++-Q%{quant}-%{pp_so_ver} = %{version}
Provides:       GraphicsMagick-C++-devel
Obsoletes:      GraphicsMagick-C++-devel <= 1.1.7

%description -n libGraphicsMagick++-devel
GraphicsMagick provides an image manipulation and translation utility
and library. It can read and write over 88 image formats, including
JPEG, TIFF, WMF, SVG, PNG, PNM, GIF, andPhoto CD. It also allows to
resize, rotate, sharpen, color reduce, or add special effects to an
image and to save the result to any supported format. GraphicsMagick
may be used to create animated or transparent .gifs, to composite
images, and to create thumbnail images.

%prep
%setup -q
%if %{bindperl}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%endif

%build
# This shouldn't be there yet.
rm -f PerlMagick/Makefile.PL
%if !%{debug_build}
export CFLAGS="%{optflags} -fPIE"
%else
export CFLAGS="$RPM_OPT_FLAGS -O0"
export CXXFLAGS="$RPM_OPT_FLAGS -O0"
%endif
%configure --enable-shared --disable-static \
%if !%{debug_build}
        --with-modules \
%else
        --without-modules \
%endif
        --enable-lzw \
        --with-frozenpaths \
        --without-perl \
        --with-magick-plus-plus \
        --with-quantum-depth=%{quant} \
        --enable-quantum-library-names \
        --docdir=%{_defaultdocdir}/%{name} \
        --with-x \
        --x-libraries=%{_libdir} \
        --x-includes=%{_prefix}/include
%if %{asan_build}
sed -i -e 's/\(^CFLAGS.*\)/\1 -fsanitize=address/' \
       -e 's/\(^LIBS =.*\)/\1 -lasan/' \
       Makefile
%endif
%if !%{debug_build}
make %{?_smp_mflags} LDFLAGS="-pie"
%else
make %{?_smp_mflags}
%endif
%if %{bindperl}
cd PerlMagick
if [ -e PerlMagick/typemap ]; then
  echo "With Graphics Magick 1.4.0, typmap exists yet, please "
  echo "no need to carry it as a package source anymore."
  exit 1
else
  cp %{SOURCE1} .
fi
perl Makefile.PL
make %{?_smp_mflags} LD_RUN_PATH="%{_libdir}"
%endif

%install
%if 0%{?suse_version} >= 1315
%make_install
%else
make install \
     DESTDIR=%{buildroot} \
     pkgdocdir=%{_defaultdocdir}/%{name}-%{maj}/
%endif
rm -f %{buildroot}%{_libdir}/libGraphicsMagick.la
rm -f %{buildroot}%{_libdir}/libGraphicsMagick++.la
rm -f %{buildroot}%{_libdir}/libGraphicsMagickWand.la
cp ChangeLog* *.txt %{buildroot}/%{_defaultdocdir}/%{name}
%if %{bindperl}
cd PerlMagick
make DESTDIR=%{buildroot} LD_RUN_PATH="%{_libdir}" install_vendor
%perl_process_packlist
# Remove unpackaged files.
rm -f `find %{buildroot}%{_libdir}/perl*/ -name perllocal.pod -type f`
rm -f `find %{buildroot}%{_libdir}/perl*/ -name .packlist -type f`
# perl modules are in lib even on 64 bit arch
rm -f `find %{buildroot}%{_libexecdir}/perl*/ -name perllocal.pod -type f`
rm -f `find %{buildroot}%{_libexecdir}/perl*/ -name .packlist -type f`
rm -f %{buildroot}%{_localstatedir}/adm/perl-modules/GraphicsMagick
%endif

%check
%if %{asan_build}
# ASAN needs /proc to be mounted
exit 0
%endif
make %{?_smp_mflags} check
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/magick/.libs:$PWD/wand/.libs
export MAGICK_CODER_MODULE_PATH=$PWD/coders/.libs
export MAGICK_CONFIGURE_PATH=$PWD/config
%if %{bindperl}
cd PerlMagick
rm -r t/ps
make test
%endif

%post -n libGraphicsMagick-Q%{quant}-%{so_ver} -p /sbin/ldconfig
%postun -n libGraphicsMagick-Q%{quant}-%{so_ver} -p /sbin/ldconfig
%post -n libGraphicsMagickWand-Q%{quant}-%{wand_so_ver} -p /sbin/ldconfig
%postun -n libGraphicsMagickWand-Q%{quant}-%{wand_so_ver} -p /sbin/ldconfig
%post -n libGraphicsMagick++-Q%{quant}-%{pp_so_ver} -p /sbin/ldconfig
%postun -n libGraphicsMagick++-Q%{quant}-%{pp_so_ver} -p /sbin/ldconfig

%files
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%docdir %{_defaultdocdir}/%{name}
%{_defaultdocdir}/%{name}
%doc %{_datadir}/%{name}-%{version}
%exclude %{_datadir}/%{name}-%{version}/config
%attr(755, root, root) %{_bindir}/gm
%{_mandir}/man1/gm.1%{ext_man}
%{_mandir}/man4/*%{ext_man}
%{_mandir}/man5/*%{ext_man}

%files -n libGraphicsMagick-Q%{quant}-%{so_ver}
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%{_libdir}/lib%{name}-Q%{quant}.so.*
%dir %{_libdir}/%{name}-%{version}
%if !%{debug_build}
%dir %{_libdir}/%{name}-%{version}/modules-Q%{quant}
%dir %{_libdir}/%{name}-%{version}/modules-Q%{quant}/coders
%dir %{_libdir}/%{name}-%{version}/modules-Q%{quant}/filters
%{_libdir}/%{name}-%{version}/modules-Q%{quant}/*/*.so
%{_libdir}/%{name}-%{version}/modules-Q%{quant}/*/*.la
%endif

%files -n libGraphicsMagick%{so_ver}-config
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%dir %{_libdir}/%{name}-%{version}/config
%{_libdir}/%{name}-%{version}/config/*.mgk
%dir %{_datadir}/%{name}-%{version}
%{_datadir}/%{name}-%{version}/config

%files -n libGraphicsMagickWand-Q%{quant}-%{wand_so_ver}
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%{_libdir}/lib%{name}Wand-Q%{quant}.so.*

%files devel
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%dir %{_includedir}/%{name}
%dir %{_includedir}/%{name}/wand
%{_includedir}/%{name}/wand/*
%dir %{_includedir}/%{name}/magick
%{_includedir}/%{name}/magick/*
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}Wand.so
%if !%{debug_build}
%dir %{_libdir}/%{name}-%{version}/modules-Q%{quant}
%endif
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/pkgconfig/%{name}Wand.pc
%attr(755, root, root) %{_bindir}/%{name}-config
%attr(755, root, root) %{_bindir}/%{name}Wand-config
%{_mandir}/man1/%{name}-config.1%{ext_man}
%{_mandir}/man1/%{name}Wand-config.1%{ext_man}

%if %{bindperl}
%files -n perl-GraphicsMagick
%dir %{perl_vendorarch}/Graphics
%dir %{perl_vendorarch}/auto/Graphics
%dir %{perl_vendorarch}/auto/Graphics/Magick
%{perl_vendorarch}/Graphics/Magick.pm
%{perl_vendorarch}/auto/Graphics/Magick/*
%{_mandir}/man3/*%{ext_man}
%endif

%files -n libGraphicsMagick++-Q%{quant}-%{pp_so_ver}
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%{_libdir}/lib%{name}++-Q%{quant}.so.*

%files -n libGraphicsMagick++-devel
%if 0%{?suse_version} < 1315
%defattr(-,root,root)
%endif
%dir %{_includedir}/%{name}
%dir %{_includedir}/%{name}/Magick++
%{_includedir}/%{name}/Magick++.h
%{_includedir}/%{name}/Magick++/*
%{_libdir}/lib%{name}++.so
%{_libdir}/pkgconfig/%{name}++.pc
%attr(755, root, root) %{_bindir}/%{name}++-config
%{_mandir}/man1/%{name}++-config.1%{ext_man}

%changelog
++++++ GraphicsMagick-CVE-2018-10805.patch ++++++
Index: GraphicsMagick-1.3.29/coders/rgb.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/rgb.c
+++ GraphicsMagick-1.3.29/coders/rgb.c
@@ -498,6 +498,7 @@ static Image *ReadRGBImage(const ImageIn
         AllocateNextImage(image_info,image);
         if (image->next == (Image *) NULL)
           {
+            MagickFreeMemory(scanline);
             DestroyImageList(image);
             return((Image *) NULL);
           }
Index: GraphicsMagick-1.3.29/coders/cmyk.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/cmyk.c
+++ GraphicsMagick-1.3.29/coders/cmyk.c
@@ -542,6 +542,7 @@ static Image *ReadCMYKImage(const ImageI
         AllocateNextImage(image_info,image);
         if (image->next == (Image *) NULL)
           {
+            MagickFreeMemory(scanline);
             DestroyImageList(image);
             return((Image *) NULL);
           }
Index: GraphicsMagick-1.3.29/coders/gray.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/gray.c
+++ GraphicsMagick-1.3.29/coders/gray.c
@@ -344,6 +344,7 @@ static Image *ReadGRAYImage(const ImageI
         AllocateNextImage(image_info,image);
         if (image->next == (Image *) NULL)
           {
+            MagickFreeMemory(scanline);
             DestroyImageList(image);
             return((Image *) NULL);
           }
++++++ GraphicsMagick-CVE-2018-16644.patch ++++++
Index: GraphicsMagick-1.2.5/coders/pict.c
===================================================================
--- GraphicsMagick-1.2.5.orig/coders/pict.c     2018-09-10 11:57:40.873041814 
+0200
+++ GraphicsMagick-1.2.5/coders/pict.c  2018-09-10 12:06:11.671820159 +0200
@@ -1220,6 +1220,9 @@ static Image *ReadPICTImage(const ImageI
             */
             type=ReadBlobMSBShort(image);
             length=ReadBlobMSBShort(image);
+            if (length > GetBlobSize(image))
+              ThrowPICTReaderException(CorruptImageError,
+                InsufficientImageDataInFile, image);
             if (length == 0)
               break;
             (void) ReadBlobMSBLong(image);
++++++ GraphicsMagick-CVE-2018-16645.patch ++++++
Index: GraphicsMagick-1.3.29/coders/bmp.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/bmp.c     2018-09-10 10:14:11.194733507 
+0200
+++ GraphicsMagick-1.3.29/coders/bmp.c  2018-09-10 10:15:46.479276166 +0200
@@ -734,6 +734,8 @@ static Image *ReadBMPImage(const ImageIn
         bmp_info.x_pixels=ReadBlobLSBLong(image); /* Horizontal resolution 
(pixels/meter) */
         bmp_info.y_pixels=ReadBlobLSBLong(image); /* Vertical resolution 
(pixels/meter) */
         bmp_info.number_colors=ReadBlobLSBLong(image); /* Number of colors */
+        if (bmp_info.number_colors > GetBlobSize(image))
+          
ThrowReaderException(CorruptImageError,InsufficientImageDataInFile,image);
         bmp_info.colors_important=ReadBlobLSBLong(image); /* Minimum important 
colors */
         profile_data=0;
         profile_size=0;
Index: GraphicsMagick-1.3.29/coders/dib.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/dib.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/dib.c  2018-09-10 10:14:11.194733507 +0200
@@ -610,6 +610,8 @@ static Image *ReadDIBImage(const ImageIn
   dib_info.x_pixels=ReadBlobLSBLong(image);
   dib_info.y_pixels=ReadBlobLSBLong(image);
   dib_info.number_colors=ReadBlobLSBLong(image);
+  if (dib_info.number_colors > GetBlobSize(image))
+    ThrowReaderException(CorruptImageError,InsufficientImageDataInFile,image);
   dib_info.colors_important=ReadBlobLSBLong(image);
   if (EOFBlob(image))
     ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);
@@ -1158,6 +1160,7 @@ ModuleExport void RegisterDIBImage(void)
   entry->encoder=(EncoderHandler) WriteDIBImage;
   entry->magick=(MagickHandler) IsDIB;
   entry->adjoin=False;
+  entry->seekable_stream=True;
   entry->stealth=True;
   entry->description="Microsoft Windows 3.X Packed Device-Independent Bitmap";
   entry->module="DIB";
@@ -1168,6 +1171,7 @@ ModuleExport void RegisterDIBImage(void)
   /* entry->encoder=(EncoderHandler) WriteDIBImage; */
   entry->magick=(MagickHandler) IsDIB;
   entry->adjoin=False;
+  entry->seekable_stream=True;
   entry->stealth=True;
   entry->raw=True; /* Requires size to work correctly. */
   entry->description="Microsoft Windows 3.X Packed Device-Independent Bitmap + 
Mask";
++++++ GraphicsMagick-CVE-2018-18544.patch ++++++
Index: GraphicsMagick-1.3.29/coders/msl.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/msl.c     2017-12-09 21:02:44.000000000 
+0100
+++ GraphicsMagick-1.3.29/coders/msl.c  2018-11-01 10:34:21.961397473 +0100
@@ -4540,6 +4540,7 @@ ProcessMSLScript(const ImageInfo *image_
   status=OpenBlob(image_info,msl_image,ReadBinaryBlobMode,exception);
   if (status == False)
     {
+      DestroyImage(msl_image);
       ThrowException(exception,FileOpenError,UnableToOpenFile,
                      msl_image->filename);
       return(False);
++++++ GraphicsMagick-CVE-2018-20184.patch ++++++
diff -r 648e3977a293 -r 15d1b5fd003b coders/tga.c
--- a/coders/tga.c      Tue Dec 11 20:53:57 2018 -0600
+++ b/coders/tga.c      Wed Dec 12 19:34:25 2018 -0600
@@ -51,9 +51,76 @@
 */
 static unsigned int
   WriteTGAImage(const ImageInfo *,Image *);
+
+
+#define TGAColormap 1          /* Colormapped image data */
+#define TGARGB 2               /* Truecolor image data */
+#define TGAMonochrome 3        /* Monochrome image data */
+#define TGARLEColormap  9      /* Colormapped image data (encoded) */
+#define TGARLERGB  10          /* Truecolor image data (encoded) */
+#define TGARLEMonochrome  11   /* Monochrome image data (encoded) */
+
+typedef struct _TGAInfo
+{
+  unsigned char
+    id_length,       /* Size of Image ID field */
+    colormap_type,   /* Color map type */
+    image_type;      /* Image type code */
+
+  unsigned short
+    colormap_index,  /* Color map origin */
+    colormap_length; /* Color map length */
+
+  unsigned char
+    colormap_size;   /* Color map entry depth */
+
+  unsigned short
+    x_origin,        /* X origin of image */
+    y_origin,        /* Y orgin of image */
+    width,           /* Width of image */
+    height;          /* Height of image */
+
+  unsigned char
+    bits_per_pixel,  /* Image pixel size */
+    attributes;      /* Image descriptor byte */
+} TGAInfo;
+
 
 
-magick_uint16_t ReadBlobLSBShortFromBuffer(unsigned char* buffer, size_t* 
readerpos)
+static void LogTGAInfo(const TGAInfo *tga_info)
+{
+  (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                        "Targa Header:\n"
+                        "    ImageType  : %s\n"
+                        "    CMapType   : %u\n"
+                        "    CMapStart  : %u\n"
+                        "    CMapLength : %u\n"
+                        "    CMapDepth  : %u\n"
+                        "    XOffset    : %u\n"
+                        "    YOffset    : %u\n"
+                        "    Width      : %u\n"
+                        "    Height     : %u\n"
+                        "    PixelDepth : %u\n"
+                        "    Attributes : 0x%.2x",
+                        ((tga_info->image_type == TGAColormap) ? "Colormapped" 
:
+                         (tga_info->image_type == TGARGB) ? "TrueColor" :
+                         (tga_info->image_type == TGAMonochrome) ? 
"Monochrome" :
+                         (tga_info->image_type == TGARLEColormap) ? 
"Colormapped-RLE" :
+                         (tga_info->image_type == TGARLERGB) ? "Truecolor-RLE" 
:
+                         (tga_info->image_type == TGARLEMonochrome) ? 
"Monochrome-RLE" :
+                         "Unknown"),
+                        (unsigned int) tga_info->colormap_type,   /* Colormap 
type */
+                        (unsigned int) tga_info->colormap_index,  /* Index of 
first colormap entry to use */
+                        (unsigned int) tga_info->colormap_length, /* # of 
elements in colormap */
+                        (unsigned int) tga_info->colormap_size,   /* Bits in 
each palette entry */
+                        tga_info->x_origin, tga_info->y_origin,
+                        tga_info->width, tga_info->height,
+                        (unsigned int) tga_info->bits_per_pixel,
+                        tga_info->attributes);
+
+}
+
+static magick_uint16_t ReadBlobLSBShortFromBuffer(unsigned char* buffer, 
size_t* readerpos)
 {
   magick_uint16_t
     value;
@@ -65,7 +132,7 @@
 }
 
 
-int ReadBlobByteFromBuffer(unsigned char* buffer, size_t* readerpos)
+static int ReadBlobByteFromBuffer(unsigned char* buffer, size_t* readerpos)
 {
   int
     value;
@@ -108,38 +175,6 @@
 */
 static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo 
*exception)
 {
-#define TGAColormap 1          /* Colormapped image data */
-#define TGARGB 2               /* Truecolor image data */
-#define TGAMonochrome 3        /* Monochrome image data */
-#define TGARLEColormap  9      /* Colormapped image data (encoded) */
-#define TGARLERGB  10          /* Truecolor image data (encoded) */
-#define TGARLEMonochrome  11   /* Monochrome image data (encoded) */
-
-  typedef struct _TGAInfo
-  {
-    unsigned char
-      id_length,       /* Size of Image ID field */
-      colormap_type,   /* Color map type */
-      image_type;      /* Image type code */
-
-    unsigned short
-      colormap_index,  /* Color map origin */
-      colormap_length; /* Color map length */
-
-    unsigned char
-      colormap_size;   /* Color map entry depth */
-
-    unsigned short
-      x_origin,        /* X origin of image */
-      y_origin,        /* Y orgin of image */
-      width,           /* Width of image */
-      height;          /* Height of image */
-
-    unsigned char
-      bits_per_pixel,  /* Image pixel size */
-      attributes;      /* Image descriptor byte */
-  } TGAInfo;
-
   Image
     *image;
 
@@ -238,24 +273,9 @@
       assert(readbufferpos == headersize);
       if (EOFBlob(image))
         ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);
-      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "ImageType=%s CMapType=%u CMapStart=%u 
CMapLength=%u CMapDepth=%u\n"
-                            "  XOffset=%u YOffset=%u Width=%u Height=%u 
PixelDepth=%u Attributes=0x%.2x",
-                            ((tga_info.image_type == TGAColormap) ? 
"Colormapped" :
-                             (tga_info.image_type == TGARGB) ? "TrueColor" :
-                             (tga_info.image_type == TGAMonochrome) ? 
"Monochrome" :
-                             (tga_info.image_type == TGARLEColormap) ? 
"Colormapped-RLE" :
-                             (tga_info.image_type == TGARLERGB) ? 
"Truecolor-RLE" :
-                             (tga_info.image_type == TGARLEMonochrome) ? 
"Monochrome-RLE" :
-                             "Unknown"),
-                            (unsigned int) tga_info.colormap_type,   /* 
Colormap type */
-                            (unsigned int) tga_info.colormap_index,  /* Index 
of first colormap entry to use */
-                            (unsigned int) tga_info.colormap_length, /* # of 
elements in colormap */
-                            (unsigned int) tga_info.colormap_size,   /* Bits 
in each palette entry */
-                            tga_info.x_origin, tga_info.y_origin,
-                            tga_info.width, tga_info.height,
-                            (unsigned int) tga_info.bits_per_pixel,
-                            tga_info.attributes);
+
+      if (image->logging)
+        LogTGAInfo(&tga_info);
 
       /*
         Validate depth.
@@ -766,38 +786,6 @@
 */
 static unsigned int WriteTGAImage(const ImageInfo *image_info,Image *image)
 {
-#define TargaColormap 1
-#define TargaRGB 2
-#define TargaMonochrome 3
-#define TargaRLEColormap  9
-#define TargaRLERGB  10
-#define TargaRLEMonochrome  11
-
-  typedef struct _TargaInfo
-  {
-    unsigned char
-      id_length,
-      colormap_type,
-      image_type;
-
-    unsigned short
-      colormap_index,
-      colormap_length;
-
-    unsigned char
-      colormap_size;
-
-    unsigned short
-      x_origin,
-      y_origin,
-      width,
-      height;
-
-    unsigned char
-      bits_per_pixel,
-      attributes;
-  } TargaInfo;
-
   const ImageAttribute
     *attribute;
 
@@ -822,11 +810,11 @@
   register unsigned char
     *q;
 
-  TargaInfo
-    targa_info;
+  TGAInfo
+    tga_info;
 
   unsigned char
-    *targa_pixels;
+    *tga_pixels;
 
   unsigned int
     write_grayscale,
@@ -904,23 +892,23 @@
       /*
         Initialize TGA raster file header.
       */
-      targa_info.id_length=0;
+      tga_info.id_length=0;
       attribute=GetImageAttribute(image,"comment");
       if (attribute != (const ImageAttribute *) NULL)
-            {
-                  unsigned char id_length =(unsigned char) 
strlen(attribute->value);
-          targa_info.id_length=Min(id_length,255);
-            }
-      targa_info.colormap_type=0;
-      targa_info.colormap_index=0;
-      targa_info.colormap_length=0;
-      targa_info.colormap_size=0;
-      targa_info.x_origin=0;
-      targa_info.y_origin=0;
-      targa_info.width=(unsigned short) image->columns;
-      targa_info.height=(unsigned short) image->rows;
-      targa_info.bits_per_pixel=8;
-      targa_info.attributes=0;
+        {
+          unsigned char id_length =(unsigned char) strlen(attribute->value);
+          tga_info.id_length=Min(id_length,255);
+        }
+      tga_info.colormap_type=0;
+      tga_info.colormap_index=0;
+      tga_info.colormap_length=0;
+      tga_info.colormap_size=0;
+      tga_info.x_origin=0;
+      tga_info.y_origin=0;
+      tga_info.width=(unsigned short) image->columns;
+      tga_info.height=(unsigned short) image->rows;
+      tga_info.bits_per_pixel=8;
+      tga_info.attributes=0;
       if (write_grayscale == MagickTrue)
         {
           /*
@@ -928,12 +916,12 @@
           */
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                                 "Writing Grayscale raster ...");
-          targa_info.image_type=TargaMonochrome;
-          targa_info.bits_per_pixel=8;
-          targa_info.colormap_type=0;
-          targa_info.colormap_index=0;
-          targa_info.colormap_length=0;
-          targa_info.colormap_size=0;
+          tga_info.image_type=TGAMonochrome;
+          tga_info.bits_per_pixel=8;
+          tga_info.colormap_type=0;
+          tga_info.colormap_index=0;
+          tga_info.colormap_length=0;
+          tga_info.colormap_size=0;
         }
       else if (image->storage_class == DirectClass)
         {
@@ -943,12 +931,12 @@
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                                 "Writing TrueColor raster ...");
 
-          targa_info.image_type=TargaRGB;
-          targa_info.bits_per_pixel=24;
+          tga_info.image_type=TGARGB;
+          tga_info.bits_per_pixel=24;
           if (image->matte)
             {
-              targa_info.bits_per_pixel=32;
-              targa_info.attributes=8;  /* # of alpha bits */
+              tga_info.bits_per_pixel=32;
+              tga_info.attributes=8;  /* # of alpha bits */
             }
         }
       else
@@ -958,30 +946,37 @@
           */
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                                 "Writing ColorMapped raster ..." );
-          targa_info.image_type=TargaColormap;
-          targa_info.colormap_type=1;
-          targa_info.colormap_index=0;
-          targa_info.colormap_length=(unsigned short) image->colors;
-          targa_info.colormap_size=24;
+          tga_info.image_type=TGAColormap;
+          tga_info.colormap_type=1;
+          tga_info.colormap_index=0;
+          tga_info.colormap_length=(unsigned short) image->colors;
+          tga_info.colormap_size=24;
         }
+
+      if (image->logging)
+        LogTGAInfo(&tga_info);
+
+      if ((image->columns > 65535) || (image->rows > 65535))
+        ThrowWriterException(CoderError,ImageColumnOrRowSizeIsNotSupported, 
image);
+
       /*
         Write TGA header.
       */
-      (void) WriteBlobByte(image,targa_info.id_length);
-      (void) WriteBlobByte(image,targa_info.colormap_type);
-      (void) WriteBlobByte(image,targa_info.image_type);
-      (void) WriteBlobLSBShort(image,targa_info.colormap_index);
-      (void) WriteBlobLSBShort(image,targa_info.colormap_length);
-      (void) WriteBlobByte(image,targa_info.colormap_size);
-      (void) WriteBlobLSBShort(image,targa_info.x_origin);
-      (void) WriteBlobLSBShort(image,targa_info.y_origin);
-      (void) WriteBlobLSBShort(image,targa_info.width);
-      (void) WriteBlobLSBShort(image,targa_info.height);
-      (void) WriteBlobByte(image,targa_info.bits_per_pixel);
-      (void) WriteBlobByte(image,targa_info.attributes);
-      if (targa_info.id_length != 0)
-        (void) WriteBlob(image,targa_info.id_length,attribute->value);
-      if (targa_info.image_type == TargaColormap)
+      (void) WriteBlobByte(image,tga_info.id_length);
+      (void) WriteBlobByte(image,tga_info.colormap_type);
+      (void) WriteBlobByte(image,tga_info.image_type);
+      (void) WriteBlobLSBShort(image,tga_info.colormap_index);
+      (void) WriteBlobLSBShort(image,tga_info.colormap_length);
+      (void) WriteBlobByte(image,tga_info.colormap_size);
+      (void) WriteBlobLSBShort(image,tga_info.x_origin);
+      (void) WriteBlobLSBShort(image,tga_info.y_origin);
+      (void) WriteBlobLSBShort(image,tga_info.width);
+      (void) WriteBlobLSBShort(image,tga_info.height);
+      (void) WriteBlobByte(image,tga_info.bits_per_pixel);
+      (void) WriteBlobByte(image,tga_info.attributes);
+      if (tga_info.id_length != 0)
+        (void) WriteBlob(image,tga_info.id_length,attribute->value);
+      if (tga_info.image_type == TGAColormap)
         {
           unsigned char
             *targa_colormap;
@@ -990,7 +985,7 @@
             Dump colormap to file (blue, green, red byte order).
           */
           targa_colormap=MagickAllocateArray(unsigned char *,
-                                             targa_info.colormap_length,3);
+                                             tga_info.colormap_length,3);
           if (targa_colormap == (unsigned char *) NULL)
             ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,
                                  image);
@@ -1001,33 +996,33 @@
               *q++=ScaleQuantumToChar(image->colormap[i].green);
               *q++=ScaleQuantumToChar(image->colormap[i].red);
             }
-          (void) WriteBlob(image,3*targa_info.colormap_length,
+          (void) WriteBlob(image,3*tga_info.colormap_length,
                            (char *) targa_colormap);
           MagickFreeMemory(targa_colormap);
         }
       /*
         Convert MIFF to TGA raster pixels.
       */
-      count=(size_t) ((targa_info.bits_per_pixel*targa_info.width) >> 3);
-      targa_pixels=MagickAllocateMemory(unsigned char *,count);
-      if (targa_pixels == (unsigned char *) NULL)
+      count=(size_t) 
((MagickArraySize(tga_info.bits_per_pixel,image->columns)) >> 3);
+      tga_pixels=MagickAllocateMemory(unsigned char *,count);
+      if (tga_pixels == (unsigned char *) NULL)
         ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image);
       for (y=(long) (image->rows-1); y >= 0; y--)
         {
           p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          q=targa_pixels;
+          q=tga_pixels;
           indexes=AccessImmutableIndexes(image);
           for (x=0; x < (long) image->columns; x++)
             {
-              if (targa_info.image_type == TargaColormap)
+              if (tga_info.image_type == TGAColormap)
                 {
                   /* Colormapped */
                   *q++=*indexes;
                   indexes++;
                 }
-              else if (targa_info.image_type == TargaMonochrome)
+              else if (tga_info.image_type == TGAMonochrome)
                 {
                   /* Grayscale */
                   if (image->storage_class == PseudoClass)
@@ -1057,7 +1052,7 @@
                 }
               p++;
             }
-          (void) WriteBlob(image,q-targa_pixels,(char *) targa_pixels);
+          (void) WriteBlob(image,q-tga_pixels,(char *) tga_pixels);
           if (image->previous == (Image *) NULL)
             if (QuantumTick(y,image->rows))
               if (!MagickMonitorFormatted(y,image->rows,&image->exception,
@@ -1065,7 +1060,7 @@
                                           image->columns,image->rows))
                 break;
         }
-      MagickFreeMemory(targa_pixels);
+      MagickFreeMemory(tga_pixels);
       if (image->next == (Image *) NULL)
         break;
       image=SyncNextImageInList(image);

++++++ GraphicsMagick-CVE-2018-20189.patch ++++++
--- a/coders/dib.c      Sun Dec 16 09:51:58 2018 -0600
+++ b/coders/dib.c      Sun Dec 16 18:24:04 2018 -0600
@@ -646,9 +646,11 @@
     ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
   if (dib_info.colors_important > 256)
     ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
+  if ((dib_info.number_colors != 0) && (dib_info.bits_per_pixel > 8))
+    ThrowReaderException(CorruptImageError,ImproperImageHeader,image);
   if ((dib_info.image_size != 0U) && (dib_info.image_size > file_size))
     ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);
-  if ((dib_info.number_colors != 0) || (dib_info.bits_per_pixel < 16))
+  if ((dib_info.number_colors != 0) || (dib_info.bits_per_pixel <= 8))
     {
       image->storage_class=PseudoClass;
       image->colors=dib_info.number_colors;
++++++ GraphicsMagick-CVE-2019-11005.patch ++++++
diff -r f7610c1281c1 -r b6fb77d7d54d coders/svg.c
--- a/coders/svg.c      Fri Apr 05 08:13:14 2019 -0500
+++ b/coders/svg.c      Fri Apr 05 08:43:15 2019 -0500
@@ -1745,12 +1745,12 @@
                     font-family.  Maybe we need a generalized solution for
                     this.
                   */
-                  if ((value[0] == '\'') && (value[strlen(value)-1] == '\''))
+                  int value_length;
+                  if ((value[0] == '\'') && ((value_length=(int) 
strlen(value)) > 2)
+                      && (value[value_length-1] == '\''))
                     {
-                      char nvalue[MaxTextExtent];
-                      (void) strlcpy(nvalue,value+1,sizeof(nvalue));
-                      nvalue[strlen(nvalue)-1]='\0';
-                      MVGPrintf(svg_info->file,"font-family '%s'\n",nvalue);
+                      MVGPrintf(svg_info->file,"font-family '%.*s'\n",
+                                (int)(value_length-2),value+1);
                     }
                   else
                     {
++++++ GraphicsMagick-CVE-2019-11006.patch ++++++
Index: GraphicsMagick-1.3.29/coders/miff.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/miff.c    2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/miff.c 2019-04-16 09:59:57.712527079 +0200
@@ -1704,8 +1704,14 @@ static Image *ReadMIFFImage(const ImageI
               p=pixels;
               for (length=0; length < image->columns; )
                 {
-                  p+=ReadBlob(image,packet_size,p);
-                  length+=*(p-1)+1;
+                  size_t
+                    bytes_read;
+
+                  if ((bytes_read=ReadBlob(image,packet_size,p)) != 
packet_size)
+                    
ThrowMIFFReaderException(CorruptImageError,UnexpectedEndOfFile,
+                                             image);
+                  p+=bytes_read;
+                    length+=*(p-1)+1;
                 }
 
               (void) ImportRLEPixels(image,quantum_type,quantum_size,pixels);

++++++ GraphicsMagick-CVE-2019-11007.patch ++++++
Index: GraphicsMagick-1.3.29/coders/png.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/png.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/png.c  2019-04-15 16:34:31.494366006 +0200
@@ -504,6 +504,44 @@ static const char* PngColorTypeToString(
   return result;
 }
 #endif /* HasPNG */
+static MagickPassFail ReallocateImageColormap(Image *image,
+  const unsigned int colors)
+{
+  register unsigned int
+    i;
+
+  unsigned int
+    prev_colors;
+
+  size_t
+    length;
+
+  /*
+    Allocate image colormap.
+  */
+  assert(image != (Image *) NULL);
+  assert(image->signature == MagickSignature);
+  if (colors > MaxColormapSize)
+    return (MagickFail);
+  prev_colors=image->colors;
+  length=MagickArraySize((size_t) colors,sizeof(PixelPacket));
+  MagickReallocMemory(PixelPacket *,image->colormap,length);
+  if (image->colormap == (PixelPacket *) NULL)
+    {
+      image->colors=0;
+      return(MagickFail);
+    }
+  image->colors=colors;
+  for (i=prev_colors; i < image->colors; i++)
+  {
+    image->colormap[i].red=0;
+    image->colormap[i].green=0;
+    image->colormap[i].blue=0;
+    image->colormap[i].opacity=OpaqueOpacity;
+  }
+  return(MagickPass);
+}
+
 
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2595,7 +2633,11 @@ static Image *ReadOnePNGImage(MngInfo *m
       png_destroy_read_struct(&ping,&ping_info,&end_info);
       MagickFreeMemory(mng_info->quantum_scanline);
       MagickFreeMemory(mng_info->png_pixels);
-      image->colors=2;
+      if (ReallocateImageColormap(image,2) == MagickFail)
+        {
+          ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,
+                               image);
+        }
       (void) SetImage(image,TransparentOpacity);
 #if defined(GMPNG_SETJMP_NOT_THREAD_SAFE)
       UnlockSemaphoreInfo(png_semaphore);
@@ -5893,7 +5935,11 @@ static Image *ReadMNGImage(const ImageIn
                   */
                   image->columns=1;
                   image->rows=1;
-                  image->colors=2;
+                  if (ReallocateImageColormap(image,2) == MagickFail)
+                    {
+                      
ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,
+                                           image);
+                    }
                   (void) SetImage(image,TransparentOpacity);
                   image->page.width=1;
                   image->page.height=1;
++++++ GraphicsMagick-CVE-2019-11010.patch ++++++
diff -r 4188ef30df01 -r a348d9661019 coders/mpc.c
--- a/coders/mpc.c      Sun Mar 31 15:52:56 2019 -0500
+++ b/coders/mpc.c      Sun Mar 31 16:53:39 2019 -0500
@@ -823,15 +823,34 @@
       {
         for (i=0; i < (long) number_of_profiles; i++)
         {
-          if (profiles[i].length == 0)
-            continue;
-          profiles[i].info=MagickAllocateMemory(unsigned char 
*,profiles[i].length);
-          if (profiles[i].info == (unsigned char *) NULL)
-            
ThrowMPCReaderException(CorruptImageError,UnableToReadGenericProfile,
-              image);
-          (void) ReadBlob(image,profiles[i].length,profiles[i].info);
-          (void) SetImageProfile(image,profiles[i].name,profiles[i].info,
-                                 profiles[i].length);
+          if (profiles[i].length > 0)
+            {
+              if ((profiles[i].length - ((magick_off_t) profiles[i].length) == 
0) &&
+                  ((BlobIsSeekable(image)
+                    && (GetBlobSize(image) - TellBlob(image)) >
+                    (magick_off_t) profiles[i].length) ||
+                   (profiles[i].length < 15*1024*1024)))
+                {
+                  profiles[i].info=MagickAllocateMemory(unsigned char 
*,profiles[i].length);
+                  if (profiles[i].info == (unsigned char *) NULL)
+                    
ThrowMPCReaderException(CorruptImageError,UnableToReadGenericProfile,
+                                             image);
+                  if (ReadBlob(image,profiles[i].length,profiles[i].info)
+                      != profiles[i].length)
+                    ThrowMPCReaderException(CorruptImageError,
+                                             UnexpectedEndOfFile,
+                                             image);
+                  (void) 
SetImageProfile(image,profiles[i].name,profiles[i].info,profiles[i].length);
+                }
+              else
+                {
+                  (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                                        "Profile size %" MAGICK_SIZE_T_F "u is 
excessively large",
+                                        (MAGICK_SIZE_T ) profiles[i].length);
+                  
ThrowMPCReaderException(CorruptImageError,ImproperImageHeader,
+                                           image);
+                }
+            }
           MagickFreeMemory(profiles[i].name);
           MagickFreeMemory(profiles[i].info);
         }





++++++ GraphicsMagick-CVE-2019-11505.patch ++++++
diff -r 5a287af63203 -r 85f5bdcd246a coders/pdb.c
--- a/coders/pdb.c      Wed Apr 10 11:27:35 2019 -0500
+++ b/coders/pdb.c      Wed Apr 10 20:48:28 2019 -0500
@@ -30,6 +30,13 @@
 %
 %
 */
+/*
+  Some information on this format may be found at
+  http://fileformats.archiveteam.org/wiki/Palm_Database_ImageViewer
+
+  Round-trip tests do not pass so this format is not included in the
+  test suite.
+*/
 
 /*
   Include declarations.
@@ -733,6 +740,7 @@
   entry->magick=(MagickHandler) IsPDB;
   entry->description="Palm Database ImageViewer Format";
   entry->module="PDB";
+  entry->coder_class=UnstableCoderClass;
   (void) RegisterMagickInfo(entry);
 }
 
@@ -842,7 +850,7 @@
     status;
 
   size_t
-        packets;
+    packets;
 
   unsigned long
     literal,
@@ -867,6 +875,7 @@
   if (status == False)
     ThrowPDBWriterException(FileOpenError,UnableToOpenFile,image);
   (void) TransformColorspace(image,RGBColorspace);
+  (void) SetImageType(image,GrayscaleType);
   bits_per_pixel=image->depth;
   if (GetImageType(image,&image->exception) == BilevelType)
     bits_per_pixel=1;
@@ -939,7 +948,7 @@
   if (buffer == (unsigned char *) NULL)
     ThrowPDBWriterException(ResourceLimitWarning,MemoryAllocationFailed,image);
   (void) memset(buffer,0,512);
-  packet_size=image->depth > 8 ? 2: 1;
+  packet_size=bits_per_pixel > 8 ? 2: 1;
   scanline=MagickAllocateArray(unsigned char *,image->columns,packet_size);
   if (scanline == (unsigned char *) NULL)
     ThrowPDBWriterException(ResourceLimitWarning,MemoryAllocationFailed,image);
@@ -956,7 +965,7 @@
   {
     if (!AcquireImagePixels(image,0,y,image->columns,1,&image->exception))
       break;
-    (void) ExportImagePixelArea(image,GrayQuantum,image->depth,scanline,0,0);
+    (void) ExportImagePixelArea(image,GrayQuantum,bits_per_pixel,scanline,0,0);
     for (x=0; x < pdb_image.width; x++)
     {
       if (x < (long) image->columns)





++++++ GraphicsMagick-CVE-2019-11506.patch ++++++
diff -r 85f5bdcd246a -r 57ac0ae85e2a coders/mat.c
--- a/coders/mat.c      Wed Apr 10 20:48:28 2019 -0500
+++ b/coders/mat.c      Thu Apr 11 20:10:35 2019 -0500
@@ -1376,11 +1376,11 @@
 %    o image:  A pointer to an Image structure.
 %
 */
-static unsigned int WriteMATLABImage(const ImageInfo *image_info,Image *image)
+static MagickPassFail WriteMATLABImage(const ImageInfo *image_info,Image 
*image)
 {
   long y;
   unsigned z;
-  unsigned int status;
+  MagickPassFail status;
   int logging;
   unsigned long DataSize;
   char padding;
@@ -1403,7 +1403,7 @@
   assert(image->signature == MagickSignature);
   logging = LogMagickEvent(CoderEvent,GetMagickModule(),"enter MAT");
   status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
-  if (status == False)
+  if (status == MagickFail)
     ThrowWriterException(FileOpenError,UnableToOpenFile,image);
 
   /*
@@ -1477,26 +1477,32 @@
         for (y=0; y<(long)image->columns; y++)
         {
           progress_quantum++;
-          (void) AcquireImagePixels(image,y,0,1,image->rows,&image->exception);
-          (void) ExportImagePixelArea(image,z2qtype[z],8,pixels,0,0);
-          (void) WriteBlob(image,image->rows,pixels);
+          if (AcquireImagePixels(image,y,0,1,image->rows,&image->exception) == 
(PixelPacket *) NULL)
+            break;
+          if (ExportImagePixelArea(image,z2qtype[z],8,pixels,0,0) == 
MagickFail)
+            break;
+          if (WriteBlob(image,image->rows,pixels) != image->rows)
+            break;
           if (QuantumTick(progress_quantum,progress_span))
             if 
(!MagickMonitorFormatted(progress_quantum,progress_span,&image->exception,
                                         SaveImageText,image->filename,
                                         image->columns,image->rows))
-              goto BreakAll;
+              break;
         }
+        if (y != (long)image->columns)
+          {
+            status=MagickFail;
+            goto BreakAll;
+          }
+
       } while(z-- >= 2);
     }
 BreakAll:
 
     while(padding-->0) (void) WriteBlobByte(image,0);
 
-    status=True;
-
-    if(pixels)
-     {MagickFreeMemory(pixels);pixels=NULL;}
-    if(image->next==NULL) break;
+    MagickFreeMemory(pixels);
+    if(status == MagickFail || image->next==NULL) break;
     image=SyncNextImageInList(image);
   }
 


++++++ GraphicsMagick-CVE-2019-12921.patch ++++++
diff -r f780c290b4ab -r 44e3d0e872eb magick/render.c
--- a/magick/render.c   Thu Jun 06 08:41:00 2019 -0500
+++ b/magick/render.c   Thu Jun 06 08:41:44 2019 -0500
@@ -2477,11 +2477,16 @@
   if (*draw_info->primitive == '\0')
     return(MagickFail);
   (void) LogMagickEvent(RenderEvent,GetMagickModule(),"begin draw-image");
-  if (*draw_info->primitive != '@')
-    primitive=AllocateString(draw_info->primitive);
-  else
+  /*
+    Read primitive from file if supplied primitive starts with '@' and
+    we are not already drawing.
+  */
+  if ((*draw_info->primitive == '@') &&
+      (DrawImageGetCurrentRecurseLevel(image) == 1))
     primitive=(char *)
       FileToBlob(draw_info->primitive+1,&length,&image->exception);
+  else
+    primitive=AllocateString(draw_info->primitive);
   if (primitive == (char *) NULL)
     return(MagickFail);
   primitive_extent=strlen(primitive);

++++++ GraphicsMagick-CVE-2019-16709.patch ++++++
Index: GraphicsMagick-1.3.29/coders/dps.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/dps.c     2017-12-09 21:02:44.000000000 
+0100
+++ GraphicsMagick-1.3.29/coders/dps.c  2019-10-08 11:55:03.901543858 +0200
@@ -168,6 +168,7 @@ static Image *ReadDPSImage(const ImageIn
   status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
   if (status == False)
     {
+      DestroyImage(image);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),"failed to open 
blob!");
       return((Image *) NULL);
     }
++++++ GraphicsMagick-CVE-2019-19950.patch ++++++
# HG changeset patch
# User Bob Friesenhahn <[email protected]>
# Date 1557593192 18000
# Node ID 44ab7f6c20b440157d50242943b5b0e3b3857014
# Parent  bc99af93614da8c8dd08ae407828758a64798666
ThrowException(), ThrowLoggedException(): Handle the case where some passed 
character strings refer to existing exception character strings.

Index: GraphicsMagick-1.3.29/magick/error.c
===================================================================
--- GraphicsMagick-1.3.29.orig/magick/error.c   2017-12-09 21:02:47.000000000 
+0100
+++ GraphicsMagick-1.3.29/magick/error.c        2020-01-03 12:39:05.746683560 
+0100
@@ -96,28 +96,32 @@ MagickExport void CatchException(const E
 {
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
-  if (exception->severity == UndefinedException)
-    return;
-  errno=exception->error_number; /* Shabby work-around for parameter limits */
-  if ((exception->severity >= WarningException) &&
-      (exception->severity < ErrorException))
-    {
-      MagickWarning2(exception->severity,exception->reason,
-        exception->description);
-      return;
-    }
-  if ((exception->severity >= ErrorException) &&
-      (exception->severity < FatalErrorException))
-    {
-      
MagickError2(exception->severity,exception->reason,exception->description);
-      return;
-    }
-  if (exception->severity >= FatalErrorException)
+
+  do
     {
-      MagickFatalError2(exception->severity,exception->reason,
-        exception->description);
-      return;
-    }
+      if (exception->severity == UndefinedException)
+        break;
+      errno=exception->error_number; /* Shabby work-around for parameter 
limits */
+      if ((exception->severity >= WarningException) &&
+          (exception->severity < ErrorException))
+        {
+          MagickWarning2(exception->severity,exception->reason,
+                         exception->description);
+          break;
+        }
+      if ((exception->severity >= ErrorException) &&
+          (exception->severity < FatalErrorException))
+        {
+          
MagickError2(exception->severity,exception->reason,exception->description);
+          break;
+        }
+      if (exception->severity >= FatalErrorException)
+        {
+          MagickFatalError2(exception->severity,exception->reason,
+                            exception->description);
+          break;
+        }
+    } while(0);
 }
 
 /*
@@ -150,6 +154,7 @@ MagickExport void CopyException(Exceptio
   assert(copy != (ExceptionInfo *) NULL);
   assert(copy->signature == MagickSignature);
   assert(original != (ExceptionInfo *) NULL);
+  assert(copy != original);
   assert(original->signature == MagickSignature);
   copy->severity=original->severity;
   MagickFreeMemory(copy->reason);
@@ -856,14 +861,21 @@ MagickExport void ThrowException(Excepti
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
   exception->severity=(ExceptionType) severity;
-  MagickFreeMemory(exception->reason);
-  if (reason)
-    exception->reason=
-      AcquireString(GetLocaleExceptionMessage(severity,reason));
-  MagickFreeMemory(exception->description);
-  if (description)
-    exception->description=
-      AcquireString(GetLocaleExceptionMessage(severity,description));
+  {
+    char *new_reason=NULL;
+    if (reason)
+      new_reason=AcquireString(GetLocaleExceptionMessage(severity,reason));
+    MagickFreeMemory(exception->reason);
+    exception->reason=new_reason;
+  }
+  {
+    char *new_description=NULL;
+    if (description)
+      new_description=
+        AcquireString(GetLocaleExceptionMessage(severity,description));
+    MagickFreeMemory(exception->description);
+    exception->description=new_description;
+  }
   exception->error_number=errno;
   MagickFreeMemory(exception->module);
   MagickFreeMemory(exception->function);
@@ -943,21 +955,36 @@ MagickExport void ThrowLoggedException(E
       return;
     }
   exception->severity=(ExceptionType) severity;
-  MagickFreeMemory(exception->reason);
-  if (reason)
-    exception->reason=
-      AcquireString(GetLocaleExceptionMessage(severity,reason));
-  MagickFreeMemory(exception->description);
-  if (description)
-    exception->description=
-      AcquireString(GetLocaleExceptionMessage(severity,description));
+  {
+    char *new_reason = NULL;
+    if (reason)
+      new_reason=AcquireString(GetLocaleExceptionMessage(severity,reason));
+    MagickFreeMemory(exception->reason);
+    exception->reason=new_reason;
+  }
+  {
+    char *new_description = NULL;
+    if (description)
+      
new_description=AcquireString(GetLocaleExceptionMessage(severity,description));
+    MagickFreeMemory(exception->description);
+    exception->description=new_description;
+  }
   exception->error_number=errno;
-  MagickFreeMemory(exception->module);
-  if (module)
-    exception->module=AcquireString(module);
-  MagickFreeMemory(exception->function);
-  if (function)
-    exception->function=AcquireString(function);
+  {
+    char *new_module = NULL;
+    if (module)
+      new_module=AcquireString(module);
+    MagickFreeMemory(exception->module);
+    exception->module=new_module;
+  }
+
+  {
+    char *new_function = NULL;
+    if (function)
+      new_function=AcquireString(function);
+    MagickFreeMemory(exception->function);
+    exception->function=new_function;
+  }
   exception->line=line;
   if (exception->reason)
     {
++++++ GraphicsMagick-CVE-2019-19951.patch ++++++
Index: GraphicsMagick-1.3.29/coders/miff.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/miff.c    2020-01-08 09:14:02.981684526 
+0100
+++ GraphicsMagick-1.3.29/coders/miff.c 2020-01-08 09:14:03.057684941 +0100
@@ -148,13 +148,13 @@ ImportRLEPixels(Image *image,
     *p;
 
   register unsigned int
+    index,
     quantum;
 
   register int
     length;
 
   register IndexPacket
-    index,
     *indexes;
 
   register long
@@ -203,10 +203,10 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      index=(*p++);
+                      index=((unsigned int) *p++);
                       VerifyColormapIndex(image,index);
                       pixel=image->colormap[index];
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -220,11 +220,11 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      index=(*p++ << 8);
-                      index|=(*p++);
+                      index =((unsigned int) *p++ << 8);
+                      index|=((unsigned int) *p++);
                       VerifyColormapIndex(image,index);
                       pixel=image->colormap[index];
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -241,13 +241,13 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      index=(*p++ << 24);
-                      index|=(*p++ << 16);
-                      index|=(*p++ << 8);
-                      index|=(*p++);
+                      index =((unsigned int) *p++ << 24);
+                      index|=((unsigned int) *p++ << 16);
+                      index|=((unsigned int) *p++ << 8);
+                      index|=((unsigned int) *p++);
                       VerifyColormapIndex(image,index);
                       pixel=image->colormap[index];
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -271,12 +271,12 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      index=(*p++);
+                      index=((unsigned int) *p++);
                       VerifyColormapIndex(image,index);
                       pixel=image->colormap[index];
-                      quantum=(*p++);
+                      quantum=((unsigned int) *p++);
                       pixel.opacity=MaxRGB-ScaleCharToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -290,14 +290,14 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      index=(*p++ << 8);
-                      index|=(*p++);
+                      index =((unsigned int) *p++ << 8);
+                      index|=((unsigned int) *p++);
                       VerifyColormapIndex(image,index);
                       pixel=image->colormap[index];
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=MaxRGB-ScaleShortToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -314,18 +314,18 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      index=(*p++ << 24);
-                      index|=(*p++ << 16);
-                      index|=(*p++ << 8);
-                      index|=(*p++);
+                      index =((unsigned int) *p++ << 24);
+                      index|=((unsigned int) *p++ << 16);
+                      index|=((unsigned int) *p++ << 8);
+                      index|=((unsigned int) *p++);
                       VerifyColormapIndex(image,index);
                       pixel=image->colormap[index];
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=MaxRGB-ScaleLongToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -354,7 +354,7 @@ ImportRLEPixels(Image *image,
                       pixel.blue=ScaleCharToQuantum(*p++);
                       pixel.opacity=ScaleCharToQuantum(*p++);
                       index=(IndexPacket) MaxRGB-ScaleCharToQuantum(*p++);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -368,22 +368,22 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum= ((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
+                      quantum= ((unsigned int) *p++ << 8);
                       quantum|=(*p++);
                       pixel.green=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       index=(IndexPacket) MaxRGB-ScaleShortToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *indexes++=index;
@@ -397,35 +397,35 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       index=(IndexPacket) MaxRGB-ScaleLongToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
-                  indexes[x]=index;
+                  *indexes++=index;
                   *q++=pixel;
                 }
               break;
@@ -450,7 +450,7 @@ ImportRLEPixels(Image *image,
                       pixel.green=ScaleCharToQuantum(*p++);
                       pixel.blue=ScaleCharToQuantum(*p++);
                       pixel.opacity=ScaleCharToQuantum(*p++);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -463,19 +463,19 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=ScaleShortToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -488,27 +488,27 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=ScaleLongToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -535,7 +535,7 @@ ImportRLEPixels(Image *image,
                       pixel.green=ScaleCharToQuantum(*p++);
                       pixel.blue=ScaleCharToQuantum(*p++);
                       pixel.opacity=MaxRGB-ScaleCharToQuantum(*p++);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -548,19 +548,19 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=MaxRGB-ScaleShortToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -573,27 +573,27 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.opacity=MaxRGB-ScaleLongToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -619,7 +619,7 @@ ImportRLEPixels(Image *image,
                       pixel.red=ScaleCharToQuantum(*p++);
                       pixel.green=ScaleCharToQuantum(*p++);
                       pixel.blue=ScaleCharToQuantum(*p++);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -632,16 +632,16 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleShortToQuantum(quantum);
-                      quantum=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleShortToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -654,22 +654,22 @@ ImportRLEPixels(Image *image,
                 {
                   if (length == 0)
                     {
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.red=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.green=ScaleLongToQuantum(quantum);
-                      quantum=(*p++ << 24);
-                      quantum|=(*p++ << 16);
-                      quantum|=(*p++ << 8);
-                      quantum|=(*p++);
+                      quantum =((unsigned int) *p++ << 24);
+                      quantum|=((unsigned int) *p++ << 16);
+                      quantum|=((unsigned int) *p++ << 8);
+                      quantum|=((unsigned int) *p++);
                       pixel.blue=ScaleLongToQuantum(quantum);
-                      length=(*p++)+1;
+                      length=((int) *p++)+1;
                     }
                   length--;
                   *q++=pixel;
@@ -1424,13 +1424,13 @@ static Image *ReadMIFFImage(const ImageI
                 {
                   for (i=0; i < (long) image->colors; i++)
                     {
-                      pixel=(*p << 8) | *(p+1);
+                      pixel=((unsigned int) *p << 8) | (unsigned int) *(p+1);
                       image->colormap[i].red=ScaleShortToQuantum(pixel);
                       p+=2;
-                      pixel=(*p << 8) | *(p+1);
+                      pixel=((unsigned int) *p << 8) | (unsigned int) *(p+1);
                       image->colormap[i].green=ScaleShortToQuantum(pixel);
                       p+=2;
-                      pixel=(*p << 8) | *(p+1);
+                      pixel=((unsigned int) *p << 8) | (unsigned int) *(p+1);
                       image->colormap[i].blue=ScaleShortToQuantum(pixel);
                       p+=2;
                     }
@@ -1440,13 +1440,22 @@ static Image *ReadMIFFImage(const ImageI
                 {
                   for (i=0; i < (long) image->colors; i++)
                     {
-                      pixel=(*p << 24) | (*(p+1) << 16) | (*(p+2) << 8) | 
*(p+3);
+                      pixel=((unsigned int) *p << 24) |
+                        ((unsigned int) *(p+1) << 16) |
+                        ((unsigned int) *(p+2) << 8) |
+                        (unsigned int) *(p+3);
                       image->colormap[i].red=ScaleLongToQuantum(pixel);
                       p+=4;
-                      pixel=(*p << 24) | (*(p+1) << 16) | (*(p+2) << 8) | 
*(p+3);
+                      pixel=((unsigned int) *p << 24) |
+                        ((unsigned int) *(p+1) << 16) |
+                        ((unsigned int) *(p+2) << 8) |
+                        (unsigned int) *(p+3);
                       image->colormap[i].green=ScaleLongToQuantum(pixel);
                       p+=4;
-                      pixel=(*p << 24) | (*(p+1) << 16) | (*(p+2) << 8) | 
*(p+3);
+                      pixel=((unsigned int) *p << 24) |
+                        ((unsigned int) *(p+1) << 16) |
+                        ((unsigned int) *(p+2) << 8) |
+                        (unsigned int) *(p+3);
                       image->colormap[i].blue=ScaleLongToQuantum(pixel);
                       p+=4;
                     }
@@ -1711,7 +1720,7 @@ static Image *ReadMIFFImage(const ImageI
                     
ThrowMIFFReaderException(CorruptImageError,UnexpectedEndOfFile,
                                              image);
                   p+=bytes_read;
-                    length+=*(p-1)+1;
+                  length+=(size_t) *(p-1)+1;
                 }
 
               (void) ImportRLEPixels(image,quantum_type,quantum_size,pixels);
++++++ GraphicsMagick-CVE-2019-19953.patch ++++++
Index: GraphicsMagick-1.3.29/coders/pict.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/pict.c    2020-01-08 09:40:23.858319142 
+0100
+++ GraphicsMagick-1.3.29/coders/pict.c 2020-01-08 09:41:13.234588841 +0100
@@ -692,7 +692,7 @@ static unsigned char *DecodeImage(const
 %
 */
 static size_t EncodeImage(Image *image,const unsigned char *scanline,
-  const unsigned long bytes_per_line,unsigned char *pixels)
+  const size_t bytes_per_line,unsigned char *pixels)
 {
 #define MaxCount  128U
 #define MaxPackbitsRunlength  128
@@ -1785,6 +1785,8 @@ static unsigned int WritePICTImage(const
   bytes_per_line=image->columns;
   if (storage_class == DirectClass)
     bytes_per_line*=image->matte ? 4 : 3;
+  if ((bytes_per_line ==0) || (bytes_per_line > 0x7FFF))
+    
ThrowPICTWriterException(CoderError,ImageColumnOrRowSizeIsNotSupported,image);
   buffer=MagickAllocateMemory(unsigned char *,PictInfoSize);
   packed_scanline=MagickAllocateMemory(unsigned char *,row_bytes+MaxCount);
   scanline=MagickAllocateMemory(unsigned char *,row_bytes);
++++++ GraphicsMagick-CVE-2019-7397.patch ++++++
Index: GraphicsMagick-1.3.29/coders/pdf.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/pdf.c     2019-02-11 19:05:36.013749175 
+0100
+++ GraphicsMagick-1.3.29/coders/pdf.c  2019-02-11 19:12:12.743653975 +0100
@@ -1375,6 +1375,7 @@ static unsigned int WritePDFImage(const
                 if (!status)
                   {
                     CloseBlob(image);
+                    MagickFreeMemory(xref);
                     return(False);
                   }
                 break;
@@ -1478,6 +1479,7 @@ static unsigned int WritePDFImage(const
                   if (!status)
                     {
                       CloseBlob(image);
+                      MagickFreeMemory(xref);
                       return(False);
                     }
                   break;
++++++ GraphicsMagick-CVE-2020-10938.patch ++++++
diff -r 751e9e822b09 -r 95abc2b694ce magick/compress.c
--- a/magick/compress.c Sun Nov 10 13:33:34 2019 -0600
+++ b/magick/compress.c Sat Nov 16 10:31:37 2019 -0600
@@ -53,21 +53,26 @@
 */
 typedef struct HuffmanTable
 {
+  unsigned int
+    id;
+
   int
-    id,
-    code,
+    code;
+
+  unsigned int
     length,
     count;
+
 } HuffmanTable;
 
 /*
   Huffman coding declarations.
 */
-#define TWId  23
-#define MWId  24
-#define TBId  25
-#define MBId  26
-#define EXId  27
+#define TWId  23U
+#define MWId  24U
+#define TBId  25U
+#define MBId  26U
+#define EXId  27U
 
 static const HuffmanTable
   MBTable[]=
@@ -202,37 +207,38 @@
 */
 #define MaxLineExtent  36
 
-static char *Ascii85Tuple(unsigned char *data)
+static char *Ascii85Tuple(char tuple[6], const unsigned char * restrict data)
 {
-  static char
-    tuple[6];
+  magick_uint32_t
+    code;
 
-  register long
-    i,
-    x;
-
-  unsigned long
-    code,
-    quantum;
-
-  code=((((unsigned long) data[0] << 8) | (unsigned long) data[1]) << 16) |
-    ((unsigned long) data[2] << 8) | (unsigned long) data[3];
-  if (code == 0L)
+  code=((((magick_uint32_t) data[0] << 8) | (magick_uint32_t) data[1]) << 16) |
+    ((magick_uint32_t) data[2] << 8) | (magick_uint32_t) data[3];
+  if (code == 0)
     {
       tuple[0]='z';
       tuple[1]='\0';
-      return(tuple);
     }
-  quantum=85UL*85UL*85UL*85UL;
-  for (i=0; i < 4; i++)
-  {
-    x=(long) (code/quantum);
-    code-=quantum*x;
-    tuple[i]=(char) (x+(int) '!');
-    quantum/=85L;
-  }
-  tuple[4]=(char) ((code % 85L)+(int) '!');
-  tuple[5]='\0';
+  else
+    {
+      register magick_int32_t
+        i,
+        x;
+
+      magick_uint32_t
+        quantum;
+
+      quantum=85U*85U*85U*85U;
+      for (i=0; i < 4; i++)
+        {
+          x=(magick_int32_t) (code/quantum);
+          code-=quantum*x;
+          tuple[i]=(char) (x+(int) '!');
+          quantum/=85;
+        }
+      tuple[4]=(char) ((code % 85)+(int) '!');
+      tuple[5]='\0';
+    }
   return(tuple);
 }
 
@@ -255,6 +261,9 @@
 
 MagickExport void Ascii85Flush(Image *image)
 {
+  char
+    tuple_buff[6];
+
   register char
     *tuple;
 
@@ -266,7 +275,7 @@
       image->ascii85->buffer[image->ascii85->offset]=0;
       image->ascii85->buffer[image->ascii85->offset+1]=0;
       image->ascii85->buffer[image->ascii85->offset+2]=0;
-      tuple=Ascii85Tuple(image->ascii85->buffer);
+      tuple=Ascii85Tuple(tuple_buff, image->ascii85->buffer);
       (void) WriteBlob(image,image->ascii85->offset+1,
         *tuple == 'z' ? "!!!!" : tuple);
     }
@@ -286,6 +295,9 @@
   register unsigned char
     *p;
 
+  char
+    tuple_buff[6];
+
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   assert(image->ascii85 != (Ascii85Info *) NULL);
@@ -296,7 +308,7 @@
   p=image->ascii85->buffer;
   for (n=image->ascii85->offset; n >= 4; n-=4)
   {
-    for (q=Ascii85Tuple(p); *q; q++)
+    for (q=Ascii85Tuple(tuple_buff,p); *q; q++)
     {
       image->ascii85->line_break--;
       if ((image->ascii85->line_break < 0) && (*q != '%'))
@@ -355,11 +367,11 @@
 %
 %
 */
-#define HashSize  1021
-#define MBHashA  293
-#define MBHashB  2695
-#define MWHashA  3510
-#define MWHashB  1178
+#define HashSize 1021U
+#define MBHashA  293U
+#define MBHashB  2695U
+#define MWHashA  3510U
+#define MWHashB  1178U
 
 #define InitializeHashTable(hash,table,a,b) \
 { \
@@ -401,26 +413,30 @@
     byte,
     code,
     color,
-    length,
     null_lines,
     runlength;
 
   unsigned int
     bit,
     index,
+    length,
     mask;
 
   long
-    count,
+    count;
+
+  unsigned long
     y;
 
   register IndexPacket
     *indexes;
 
-  register long
-    i,
+  register unsigned long
     x;
 
+  unsigned int
+    i;
+
   register PixelPacket
     *q;
 
@@ -481,13 +497,13 @@
   image->x_resolution=204.0;
   image->y_resolution=196.0;
   image->units=PixelsPerInchResolution;
-  for (y=0; ((y < (long) image->rows) && (null_lines < 3)); )
+  for (y=0; ((y < image->rows) && (null_lines < 3)); )
   {
     /*
       Initialize scanline to white.
     */
     p=scanline;
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < image->columns; x++)
       *p++=0;
     /*
       Decode Huffman encoded scanline.
@@ -502,7 +518,7 @@
     {
       if (byte == EOF)
         break;
-      if (x >= (long) image->columns)
+      if (x >= image->columns)
         {
           while (runlength < 11)
             InputBit(bit);
@@ -563,7 +579,7 @@
         case TBId:
         {
           count+=entry->count;
-          if ((x+count) > (long) image->columns)
+          if ((x+(unsigned long) count) > image->columns)
             count=(long) image->columns-x;
           if (count > 0)
             {
@@ -603,7 +619,7 @@
         break;
       }
     indexes=AccessMutableIndexes(image);
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < image->columns; x++)
     {
       index=(unsigned int) (*p++);
       indexes[x]=index;
@@ -695,7 +711,9 @@
     runlength;
 
   long
-    n,
+    n;
+
+  unsigned long
     y;
 
   Image
@@ -704,8 +722,10 @@
   register const IndexPacket
     *indexes;
 
-  register long
-    i,
+  unsigned long
+    i;
+
+  register unsigned long
     x;
 
   register const PixelPacket
@@ -772,10 +792,10 @@
     polarity=(PixelIntensityToQuantum(&huffman_image->colormap[0]) <
       PixelIntensityToQuantum(&huffman_image->colormap[1]) ? 0x00 : 0x01);
   q=scanline;
-  for (i=(long) width; i > 0; i--)
+  for (i=0; i < width; i++) /* was: for (i=(long) width; i > 0; i--) */
     *q++=(unsigned char) polarity;
   q=scanline;
-  for (y=0; y < (long) huffman_image->rows; y++)
+  for (y=0; y < huffman_image->rows; y++)
   {
     p=AcquireImagePixels(huffman_image,0,y,huffman_image->columns,1,
       &huffman_image->exception);
@@ -785,7 +805,7 @@
         break;
       }
     indexes=AccessImmutableIndexes(huffman_image);
-    for (x=0; x < (long) huffman_image->columns; x++)
+    for (x=0; x < huffman_image->columns; x++)
     {
       *q=(unsigned char) (indexes[x] == polarity ? !polarity : polarity);
       q++;

++++++ GraphicsMagick-dcm.c-update.patch ++++++
Index: GraphicsMagick-1.3.29/coders/dcm.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/dcm.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/dcm.c  2018-06-13 20:03:24.671464110 +0200
@@ -183,7 +183,7 @@ typedef struct _DicomStream
     lower_lim;
 
   Quantum
-    *rescale_map;
+    *rescale_map; /* Allocated with dcm->max_value_in+1 entries */
 
 #if defined(USE_GRAYMAP)
   unsigned short
@@ -3336,6 +3336,10 @@ static MagickPassFail funcDCM_Palette(Im
       return MagickFail;
     }
 
+  if (image->logging)
+    (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                          "Palette with %" MAGICK_SIZE_T_F "u entries...",
+                          (MAGICK_SIZE_T) dcm->length);
   /*
     Initialize colormap (entries are always 16 bit)
     1201/2/3 = red/green/blue palette
@@ -3781,21 +3785,38 @@ static MagickPassFail DCM_SetupRescaleMa
     Xw_min,
     Xw_max;
 
-  unsigned long
+  unsigned int
     i;
 
   if (dcm->rescaling == DCM_RS_NONE)
     return MagickPass;
 
+  if (image->logging)
+    (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                          "Set up rescale map for input range of %u"
+                          " (%u entries)...",
+                          dcm->max_value_in+1,MaxMap+1);
+
+  /*
+    The rescale map must be limited to MaxMap+1 entries, which is 256
+    or 65536, depending on QuantumDepth.  Using a QuantumDepth less
+    than 16 for DICOM is a bad idea.
+
+    The dcm->significant_bits value is limited to 16 (larger values
+    are outright rejected) so dcm->max_value_in and dcm->max_value_out
+    are limited to 65535.
+  */
+
   if (dcm->rescale_map == (Quantum *) NULL)
     {
-      dcm->rescale_map=MagickAllocateArray(Quantum 
*,dcm->max_value_in+1,sizeof(Quantum));
+      size_t num_entries = Max(MaxMap+1,dcm->max_value_in+1);
+      dcm->rescale_map=MagickAllocateArray(Quantum 
*,num_entries,sizeof(Quantum));
       if (dcm->rescale_map == NULL)
         {
           
ThrowException(exception,ResourceLimitError,MemoryAllocationFailed,image->filename);
           return MagickFail;
         }
-      (void) memset(dcm->rescale_map,0,(size_t) 
dcm->max_value_in+1*sizeof(Quantum));
+      (void) memset(dcm->rescale_map,0,num_entries*sizeof(Quantum));
     }
 
   if (dcm->window_width == 0)
@@ -3837,8 +3858,9 @@ static MagickPassFail DCM_SetupRescaleMa
         
dcm->rescale_map[i]=(Quantum)(((Xr-Xw_min)/(win_width-1))*dcm->max_value_out+0.5);
     }
   if (dcm->phot_interp == DCM_PI_MONOCHROME1)
-    for (i=0; i < (dcm->max_value_in+1); i++)
+    for (i=0; i <= dcm->max_value_in; i++)
       dcm->rescale_map[i]=dcm->max_value_out-dcm->rescale_map[i];
+
   return MagickPass;
 }
 
@@ -3904,7 +3926,6 @@ void DCM_SetRescaling(DicomStream *dcm,i
   dcm->rescaling=DCM_RS_PRE;
 }
 
-#if 0
 /*
   FIXME: This code is totally broken since DCM_SetupRescaleMap
   populates dcm->rescale_map and dcm->rescale_map has
@@ -4023,14 +4044,13 @@ static MagickPassFail DCM_PostRescaleIma
     }
   return MagickPass;
 }
-#endif
 
 static MagickPassFail DCM_ReadPaletteImage(Image *image,DicomStream 
*dcm,ExceptionInfo *exception)
 {
-  long
+  unsigned long
     y;
 
-  register long
+  register unsigned long
     x;
 
   register PixelPacket
@@ -4051,13 +4071,13 @@ static MagickPassFail DCM_ReadPaletteIma
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                           "Reading Palette image...");
 
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < image->rows; y++)
     {
       q=SetImagePixels(image,0,y,image->columns,1);
       if (q == (PixelPacket *) NULL)
         return MagickFail;
       indexes=AccessMutableIndexes(image);
-      for (x=0; x < (long) image->columns; x++)
+      for (x=0; x < image->columns; x++)
         {
           if (dcm->bytes_per_pixel == 1)
             {
@@ -4113,6 +4133,8 @@ static MagickPassFail DCM_ReadPaletteIma
               index=(IndexPacket) (index);
               VerifyColormapIndex(image,index);
               indexes[x]=index;
+              *q=image->colormap[index];
+              q++;
             }
 
           if (EOFBlob(image))
@@ -4135,16 +4157,16 @@ static MagickPassFail DCM_ReadPaletteIma
 
 static MagickPassFail DCM_ReadGrayscaleImage(Image *image,DicomStream 
*dcm,ExceptionInfo *exception)
 {
-  long
+  unsigned long
     y;
 
-  register long
+  register unsigned long
     x;
 
   register PixelPacket
     *q;
 
-#if defined(GRAYSCALE_USES_PALETTE)
+#if defined(GRAYSCALE_USES_PALETTE) /* not used */
   register IndexPacket
     *indexes;
 #endif
@@ -4157,20 +4179,27 @@ static MagickPassFail DCM_ReadGrayscaleI
 
   if (image->logging)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                          "Reading Grayscale image...");
+                          "Reading Grayscale %lux%lu 
image...",image->columns,image->rows);
+
+#if !defined(GRAYSCALE_USES_PALETTE)
+  /*
+    If a palette was provided, the image may be in PseudoClass
+  */
+  image->storage_class=DirectClass;
+#endif
 
   dcm->lower_lim = dcm->max_value_in;
   dcm->upper_lim = -(dcm->lower_lim);
   byte=0;
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < image->rows; y++)
     {
-      q=SetImagePixels(image,0,y,image->columns,1);
+      q=SetImagePixelsEx(image,0,y,image->columns,1,exception);
       if (q == (PixelPacket *) NULL)
         return MagickFail;
-#if defined(GRAYSCALE_USES_PALETTE)
+#if defined(GRAYSCALE_USES_PALETTE) /* not used */
       indexes=AccessMutableIndexes(image);
 #endif
-      for (x=0; x < (long) image->columns; x++)
+      for (x=0; x < image->columns; x++)
         {
           if (dcm->bytes_per_pixel == 1)
             {
@@ -4223,7 +4252,7 @@ static MagickPassFail DCM_ReadGrayscaleI
               if ((int) l > dcm->upper_lim)
                 dcm->upper_lim = l;
             }
-#if defined(GRAYSCALE_USES_PALETTE)
+#if defined(GRAYSCALE_USES_PALETTE) /* not used */
           if (dcm->rescaling == DCM_RS_PRE)
             indexes[x]=dcm->rescale_map[index];
           else
@@ -4231,10 +4260,13 @@ static MagickPassFail DCM_ReadGrayscaleI
 #else
           if ((dcm->rescaling == DCM_RS_PRE) &&
               (dcm->rescale_map != (Quantum *) NULL))
-            index=dcm->rescale_map[index];
+            {
+              index=dcm->rescale_map[index];
+            }
           q->red=index;
           q->green=index;
           q->blue=index;
+          q->opacity=OpaqueOpacity;
           q++;
 #endif
           if (EOFBlob(image))
@@ -4243,7 +4275,7 @@ static MagickPassFail DCM_ReadGrayscaleI
               return MagickFail;
             }
         }
-      if (!SyncImagePixels(image))
+      if (!SyncImagePixelsEx(image,exception))
         return MagickFail;
       if (image->previous == (Image *) NULL)
         if (QuantumTick(y,image->rows))
@@ -4270,6 +4302,12 @@ static MagickPassFail DCM_ReadPlanarRGBI
                           "Reading Planar RGB %s compressed image with %u 
planes...",
                           (dcm->transfer_syntax == DCM_TS_RLE ? "RLE" : "not"),
                           dcm->samples_per_pixel);
+  /*
+    Force image to DirectClass since we are only updating DirectClass
+    representation.  The image may be in PseudoClass if we were
+    previously provided with a Palette.
+  */
+  image->storage_class=DirectClass;
 
   for (plane=0; plane < dcm->samples_per_pixel; plane++)
     {
@@ -4353,6 +4391,13 @@ static MagickPassFail DCM_ReadRGBImage(I
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                           "Reading RGB image...");
 
+  /*
+    Force image to DirectClass since we are only updating DirectClass
+    representation.  The image may be in PseudoClass if we were
+    previously provided with a Palette.
+  */
+  image->storage_class=DirectClass;
+
   for (y=0; y < image->rows; y++)
     {
       q=GetImagePixels(image,0,y,image->columns,1);
@@ -4406,6 +4451,7 @@ static MagickPassFail DCM_ReadRGBImage(I
           q->red=(Quantum) red;
           q->green=(Quantum) green;
           q->blue=(Quantum) blue;
+          q->opacity=OpaqueOpacity;
           q++;
           if (EOFBlob(image))
             {
@@ -4622,7 +4668,7 @@ static MagickPassFail DCM_ReadNonNativeI
                   dcm->bytes_per_pixel=2;
                 dcm->max_value_in=MaxValueGivenBits(dcm->significant_bits);
                 dcm->max_value_out=dcm->max_value_in;
-                /*status=DCM_PostRescaleImage(next_image,dcm,True,exception);*/
+                status=DCM_PostRescaleImage(next_image,dcm,True,exception);
               }
           if (status == MagickPass)
             {
@@ -4928,9 +4974,9 @@ static Image *ReadDCMImage(const ImageIn
               if (image->logging)
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                                       "Rescaling image channels...");
-              /*status = DCM_PostRescaleImage(image,&dcm,False,exception);
-                if (status != MagickPass)
-                break;*/
+              status = DCM_PostRescaleImage(image,&dcm,False,exception);
+              if (status != MagickPass)
+                break;
             }
         }
 
++++++ GraphicsMagick-disable-indirect-reads.patch ++++++
--- a/magick/utility.c  Mon Jun 03 08:24:59 2019 -0500
+++ a/magick/utility.c  Thu Jun 06 08:41:00 2019 -0500
@@ -5934,16 +5934,6 @@ 
     return((char *) NULL);
   text=(char *) formatted_text;
   /*
-    If text starts with '@' then try to replace it with the content of
-    the file name which follows.
-  */
-  if ((*text == '@') && IsAccessible(text+1))
-    {
-      text=(char *) FileToBlob(text+1,&length,&image->exception);
-      if (text == (char *) NULL)
-        return((char *) NULL);
-    }
-  /*
     Translate any embedded format characters.
   */
   length=strlen(text)+MaxTextExtent;

++++++ GraphicsMagick-disable-insecure-coders.patch ++++++
Index: GraphicsMagick-1.3.29/coders/pdf.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/pdf.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/pdf.c  2019-05-28 11:02:55.701995167 +0200
@@ -495,7 +495,7 @@ ModuleExport void RegisterPDFImage(void)
   entry->seekable_stream=True;
   entry->description="Encapsulated Portable Document Format";
   entry->module="PDF";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("PDF");
@@ -506,7 +506,7 @@ ModuleExport void RegisterPDFImage(void)
   entry->seekable_stream=True;
   entry->description="Portable Document Format";
   entry->module="PDF";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 }
 
Index: GraphicsMagick-1.3.29/coders/ps.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/ps.c      2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/ps.c   2019-05-28 11:02:55.701995167 +0200
@@ -458,7 +458,7 @@ ModuleExport void RegisterPSImage(void)
   entry->adjoin=False;
   entry->description="Adobe Encapsulated PostScript Interchange format";
   entry->module="PS";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("EPS");
@@ -468,7 +468,7 @@ ModuleExport void RegisterPSImage(void)
   entry->adjoin=False;
   entry->description="Adobe Encapsulated PostScript";
   entry->module="PS";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("EPSF");
@@ -478,7 +478,7 @@ ModuleExport void RegisterPSImage(void)
   entry->adjoin=False;
   entry->description="Adobe Encapsulated PostScript";
   entry->module="PS";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("EPSI");
@@ -488,7 +488,7 @@ ModuleExport void RegisterPSImage(void)
   entry->adjoin=False;
   entry->description="Adobe Encapsulated PostScript Interchange format";
   entry->module="PS";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("PS");
@@ -497,7 +497,7 @@ ModuleExport void RegisterPSImage(void)
   entry->magick=(MagickHandler) IsPS;
   entry->description="Adobe PostScript";
   entry->module="PS";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 }
 
Index: GraphicsMagick-1.3.29/coders/ps2.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/ps2.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/ps2.c  2019-05-28 11:02:55.701995167 +0200
@@ -244,7 +244,7 @@ ModuleExport void RegisterPS2Image(void)
   entry->seekable_stream=True;
   entry->description="Adobe Level II Encapsulated PostScript";
   entry->module="PS2";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("PS2");
@@ -252,7 +252,7 @@ ModuleExport void RegisterPS2Image(void)
   entry->seekable_stream=True;
   entry->description="Adobe Level II PostScript";
   entry->module="PS2";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 }
 
Index: GraphicsMagick-1.3.29/coders/ps3.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/ps3.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/ps3.c  2019-05-28 11:02:55.701995167 +0200
@@ -386,7 +386,7 @@ ModuleExport void RegisterPS3Image(void)
   entry->description="Adobe Level III Encapsulated PostScript";
   entry->seekable_stream=MagickTrue;
   entry->module="PS3";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 
   entry=SetMagickInfo("PS3");
@@ -394,7 +394,7 @@ ModuleExport void RegisterPS3Image(void)
   entry->description="Adobe Level III PostScript";
   entry->seekable_stream=MagickTrue;
   entry->module="PS3";
-  entry->coder_class=PrimaryCoderClass;
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 }
 
Index: GraphicsMagick-1.3.29/config/delegates.mgk.in
===================================================================
--- GraphicsMagick-1.3.29.orig/config/delegates.mgk.in  2016-05-30 
19:19:54.000000000 +0200
+++ GraphicsMagick-1.3.29/config/delegates.mgk.in       2019-05-28 
11:02:55.701995167 +0200
@@ -76,28 +76,8 @@
   <delegate decode="dot" command='"@DOTDecodeDelegate@" -Tps "%i" -o "%o"' />
   <delegate decode="dvi" command='"@DVIDecodeDelegate@" -q -o "%o" "%i"' />
   <delegate decode="edit" stealth="True" command='"@EditorDelegate@" -title 
"Edit Image Comment" -e vi "%o"' />
-  <delegate decode="eps" encode="pdf" mode="bi" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSPDFDevice@ 
"-sOutputFile=%o" -- "%i" -c quit' />
-  <delegate decode="eps" encode="ps" mode="bi" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSPSDevice@ 
"-sOutputFile=%o" -- "%i" -c quit' />
   <delegate decode="fig" command='"@FIGDecodeDelegate@" -L ps "%i" "%o"' />
 
-  <!-- Read monochrome Postscript, EPS, and PDF  -->
-  <delegate decode="gs-mono" stealth="True" command='"@PSDelegate@" -q -dBATCH 
-dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSMonoDevice@ 
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s "-sOutputFile=%s" -- "%s" -c 
quit' />
-
-  <!-- Read grayscale Postscript, EPS, and PDF  -->
-  <delegate decode="gs-gray" stealth="True" command='"@PSDelegate@" -q -dBATCH 
-dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSGrayDevice@ 
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s "-sOutputFile=%s" -- "%s" -c 
quit' />
-
-  <!-- Read colormapped Postscript, EPS, and PDF  -->
-  <delegate decode="gs-palette" stealth="True" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSPaletteDevice@ 
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s "-sOutputFile=%s" -- "%s" -c 
quit' />
-
-  <!-- Read color Postscript, EPS, and PDF  -->
-  <delegate decode="gs-color" stealth="True" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSColorDevice@ 
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s "-sOutputFile=%s" -- "%s" -c 
quit' />
-
-  <!-- Read color+alpha Postscript, EPS, and PDF  -->
-  <delegate decode="gs-color+alpha" stealth="True" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSColorAlphaDevice@ 
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s "-sOutputFile=%s" -- "%s" -c 
quit' />
-
-  <!-- Read CMYK Postscript, EPS, and PDF  -->
-  <delegate decode="gs-cmyk" stealth="True" command='"@PSDelegate@" -q -dBATCH 
-dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSCMYKDevice@ 
-dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s "-sOutputFile=%s" -- "%s" -c 
quit' />
-
   <delegate decode="hpg" command='"@HPGLDecodeDelegate@" -q -m eps -f 
`basename "%o"` "%i" && @MVDelegate@ -f `basename "%o"` "%o"' />
   <delegate decode="hpgl" command='"@HPGLDecodeDelegate@" -q -m eps -f 
`basename "%o"` "%i" && @MVDelegate@ -f `basename "%o"` "%o"' />
   <!-- Read HTML file  -->
@@ -110,16 +90,10 @@
   <delegate decode="mpeg" command='"@MPEGDecodeDelegate@" -q -b "%i" -f -o3 
"%u%%05d"; @GMDelegate@ convert -temporary "%u*.ppm" "miff:%o" ; rm -f 
"%u"*.ppm ' />
   <!-- Write MPEG file using mpeg2encode -->
   <delegate encode="mpeg-encode" stealth="True" 
command='"@MPEGEncodeDelegate@" "%i" "%o"' />
-  <!-- Convert PDF to Encapsulated Poscript using Ghostscript -->
-  <delegate decode="pdf" encode="eps" mode="bi" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSEPSDevice@ 
"-sOutputFile=%o" -- "%i" -c quit' />
-  <!-- Convert PDF to Postcript using Ghostscript -->
-  <delegate decode="pdf" encode="ps" mode="bi" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSPSDevice@ 
"-sOutputFile=%o" -- "%i" -c quit' />
   <!-- Convert PNM file to IFF ILBM format using ppmtoilbm -->
   <delegate decode="pnm" encode="ilbm" mode="encode" 
command='"@ILBMEncodeDelegate@" -24if "%i" > "%o"' />
   <delegate decode="pnm" encode="launch" mode="encode" 
command='"@LaunchDelegate@" "%i"' />
   <delegate decode="pnm" encode="win" mode="encode" command='"@GMDelegate@" 
display -immutable "%i"' />
-  <delegate decode="ps" encode="eps" mode="bi" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSEPSDevice@ 
"-sOutputFile=%o" -- "%i" -c quit' />
-  <delegate decode="ps" encode="pdf" mode="bi" command='"@PSDelegate@" -q 
-dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=@GSPDFDevice@ 
"-sOutputFile=%o" -- "%i" -c quit' />
   <delegate decode="ps" encode="print" mode="encode" 
command='"@PrintDelegate@" "%i"' />
   <!-- Read HTML file  -->
   <delegate decode="shtml" command='"@HTMLDecodeDelegate@" -U -o "%o" "%i"' />
Index: GraphicsMagick-1.3.29/Makefile.in
===================================================================
--- GraphicsMagick-1.3.29.orig/Makefile.in      2018-04-29 20:05:43.000000000 
+0200
+++ GraphicsMagick-1.3.29/Makefile.in   2019-05-28 11:02:55.705995190 +0200
@@ -3876,7 +3876,6 @@ TESTS_TESTS = \
        tests/rwfile.tap \
        tests/rwfile_sized.tap \
        tests/rwfile_miff.tap \
-       tests/rwfile_pdf.tap \
        tests/rwfile_deep.tap
 
 TESTS_EXTRA_DIST = \
Index: GraphicsMagick-1.3.29/tests/rwblob.tap
===================================================================
--- GraphicsMagick-1.3.29.orig/tests/rwblob.tap 2017-07-04 23:32:09.000000000 
+0200
+++ GraphicsMagick-1.3.29/tests/rwblob.tap      2019-05-28 11:02:55.705995190 
+0200
@@ -10,7 +10,7 @@ rwblob=./rwblob
 check_types='bilevel gray pallette truecolor'
 
 # Number of tests we plan to run
-test_plan_fn 204
+test_plan_fn 196
 
 # ART format
 for type in ${check_types}
@@ -66,18 +66,6 @@ do
   test_command_fn "DPX ${type}" ${MEMCHECK} ${rwblob} 
"${SRCDIR}/input_${type}.miff" DPX
 done
 
-# EPDF format
-for type in ${check_types}
-do
-  test_command_fn "EPDF ${type}" -F 'PS' ${MEMCHECK} ${rwblob} 
"${SRCDIR}/input_${type}.miff" EPDF
-done
-
-# EPT format
-for type in ${check_types}
-do
-  test_command_fn "EPT ${type}" -F 'PS TIFF' ${MEMCHECK} ${rwblob} 
"${SRCDIR}/input_${type}.miff" EPT
-done
-
 # FAX format
 for type in ${check_types}
 do
Index: GraphicsMagick-1.3.29/tests/rwfile.tap
===================================================================
--- GraphicsMagick-1.3.29.orig/tests/rwfile.tap 2018-01-20 15:31:41.000000000 
+0100
+++ GraphicsMagick-1.3.29/tests/rwfile.tap      2019-05-28 11:02:55.705995190 
+0200
@@ -11,7 +11,7 @@ rwfile=./rwfile
 check_types='bilevel gray pallette truecolor'
 
 # Number of tests we plan to run
-test_plan_fn 576
+test_plan_fn 536
 
 # ART format
 for type in ${check_types}
@@ -83,48 +83,6 @@ do
   test_command_fn "DPX ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec 
"out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" DPX
 done
 
-# EPDF format
-for type in ${check_types}
-do
-  test_command_fn "EPDF ${type}" -F 'PS' ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" EPDF
-  #test_command_fn "EPDF ${type} (stdio)" -F 'PS' ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" EPDF
-done
-
-# EPSF format
-for type in ${check_types}
-do
-  test_command_fn "EPSF ${type}" -F 'PS' ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" EPSF
-  #test_command_fn "EPSF ${type} (stdio)" -F 'PS' ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" EPSF
-done
-
-# EPSI format
-for type in ${check_types}
-do
-  test_command_fn "EPSI ${type}" -F 'PS' ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" EPSI
-  #test_command_fn "EPSI ${type} (stdio)" -F 'PS' ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" EPSI
-done
-
-# EPI format
-for type in ${check_types}
-do
-  test_command_fn "EPI ${type}" -F 'PS' ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" EPI
-  #test_command_fn "EPI ${type} (stdio)" -F 'PS' ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" EPI
-done
-
-# EPS format
-for type in ${check_types}
-do
-  test_command_fn "EPS ${type}" -F 'PS' ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" EPS
-  #test_command_fn "EPS ${type} (stdio)" -F 'PS' ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" EPS
-done
-
-# EPT format
-for type in ${check_types}
-do
-  test_command_fn "EPT ${type}" -F 'PS TIFF' ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" EPT
-  #test_command_fn "EPT ${type} (stdio)" -F 'PS TIFF' ${MEMCHECK} ${rwfile} 
-stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" EPT
-done
-
 # FAX format
 for type in ${check_types}
 do
@@ -284,13 +242,6 @@ do
   test_command_fn "PCX ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec 
"out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PCX
 done
 
-# PDF format
-for type in ${check_types}
-do
-  test_command_fn "PDF ${type}" -F PS ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" PDF
-  #test_command_fn "PDF ${type} (stdio)" -F PS ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PDF
-done
-
 # PGM format
 for type in ${check_types}
 do
@@ -350,27 +301,6 @@ do
   done
 done
 
-# PS format
-for type in ${check_types}
-do
-  test_command_fn "PS ${type}" -F PS ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" PS
-  #test_command_fn "PS ${type} (stdio)" -F PS ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PS
-done
-
-# PS2 format
-for type in ${check_types}
-do
-  test_command_fn "PS2 ${type}" -F PS ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" PS2
-  #test_command_fn "PS2 ${type} (stdio)" -F PS ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PS2
-done
-
-# PS3 format
-for type in ${check_types}
-do
-  test_command_fn "PS3 ${type}" -F PS ${MEMCHECK} ${rwfile} -filespec 
"out_${type}_%d" "${SRCDIR}/input_${type}.miff" PS3
-  #test_command_fn "PS3 ${type} (stdio)" -F PS ${MEMCHECK} ${rwfile} -stdio 
-filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PS3
-done
-
 # PSD format
 for type in ${check_types}
 do
Index: GraphicsMagick-1.3.29/coders/pcl.c
===================================================================
--- GraphicsMagick-1.3.29.orig/coders/pcl.c     2018-04-29 20:01:26.000000000 
+0200
+++ GraphicsMagick-1.3.29/coders/pcl.c  2019-05-28 11:03:16.954116429 +0200
@@ -143,6 +143,7 @@ ModuleExport void RegisterPCLImage(void)
   entry->adjoin=True;
   entry->description="Page Control Language";
   entry->module="PCL";
+  entry->coder_class=BrokenCoderClass;
   (void) RegisterMagickInfo(entry);
 }
 
++++++ GraphicsMagick-perl-linkage.patch ++++++
diff -up GraphicsMagick-1.3.14/PerlMagick/Makefile.PL.in.perl_linkage 
GraphicsMagick-1.3.14/PerlMagick/Makefile.PL.in
--- GraphicsMagick-1.3.14/PerlMagick/Makefile.PL.in.perl_linkage        
2012-02-25 14:43:38.000000000 -0600
+++ GraphicsMagick-1.3.14/PerlMagick/Makefile.PL.in     2012-02-26 
07:35:38.542731280 -0600
@@ -78,7 +78,7 @@ WriteMakefile
    'INSTALLBIN'        => $magick_BIN_DIR,
 
    # Library specification
-   'LIBS'      => ["-L$magick_LIB_DIR -lGraphicsMagick $magick_LDFLAGS 
$magick_DEP_LIBS"],
+   'LIBS'      => ["-L$magick_LIB_DIR -L../magick/.libs -lGraphicsMagick 
$magick_LDFLAGS $magick_DEP_LIBS"],
 
    # Perl binary name (if a Perl binary is built)
    'MAP_TARGET'        => 'PerlMagick',
++++++ GraphicsMagick-xwd.c-update.patch ++++++
++++ 836 lines (skipped)

++++++ typemap ++++++
Graphics::Magick T_PTROBJ

Reply via email to