CVE-2015-8896: Other (NVD-CWE-Other)
value: Integer truncation issue in coders/pict.c in ImageMagick before 7.0.5-0 allows remote attackers to cause a denial of service (application crash) via a crafted .pict file.
CWE description: NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
CVSS v3 base score: 6.5
Published: 2017-03-15T19:59Z
Repository: https://github.com/ImageMagick/ImageMagick
Language: C
Files changed: MagickCore/memory.c, MagickCore/studio.h, MagickCore/version.c, MagickCore/version.h, MagickWand/studio.h, coders/icon.c, coders/pict.c, configure, configure.ac
Commit date: 2015-05-30 00:49:11 +0000
Diff: diff --git a/MagickCore/memory.c b/MagickCore/memory.c
index fa1d44ea7..50755a91a 100644
--- a/MagickCore/memory.c
+++ b/MagickCore/memory.c
@@ -604,28 +604,40 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
       if (memory_info->blob != NULL)
         memory_info->type=MapVirtualMemory;
       else
         RelinquishMagickResource(MapResource,length);
     }
-  if (memory_info->blob == NULL)
+  if ((memory_info->blob == NULL) &&
+      (AcquireMagickResource(DiskResource,length) != MagickFalse))
     {
       int
         file;
 
       /*
         Anonymous memory mapping failed, try file-backed memory mapping.
       */
       file=AcquireUniqueFileResource(memory_info->filename);
-      if (file != -1)
+      if (file == -1)
+        RelinquishMagickResource(DiskResource,length);
+      else
         {
-          if ((lseek(file,length-1,SEEK_SET) >= 0) && (write(file,"",1) == 1))
+          if ((lseek(file,length-1,SEEK_SET) < 0) || (write(file,"",1) != 1))
+            RelinquishMagickResource(DiskResource,length);
+          else
             {
-              memory_info->blob=MapBlob(file,IOMode,0,length);
-              if (memory_info->blob != NULL)
+              if (AcquireMagickResource(MapResource,length) == MagickFalse)
+                RelinquishMagickResource(DiskResource,length);
+              else
                 {
-                  memory_info->type=MapVirtualMemory;
-                  (void) AcquireMagickResource(MapResource,length);
+                  memory_info->blob=MapBlob(file,IOMode,0,length);
+                  if (memory_info->blob != NULL)
+                    memory_info->type=MapVirtualMemory;
+                  else
+                    {
+                      RelinquishMagickResource(MapResource,length);
+                      RelinquishMagickResource(DiskResource,length);
+                    }
                 }
             }
           (void) close(file);
         }
     }
@@ -1031,11 +1043,14 @@ MagickExport MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info)
       {
         (void) UnmapBlob(memory_info->blob,memory_info->length);
         memory_info->blob=NULL;
         RelinquishMagickResource(MapResource,memory_info->length);
         if (*memory_info->filename != '\0')
-          (void) RelinquishUniqueFileResource(memory_info->filename);
+          {
+            (void) RelinquishUniqueFileResource(memory_info->filename);
+            RelinquishMagickResource(DiskResource,memory_info->length);
+          }
         break;
       }
       case UnalignedVirtualMemory:
       default:
       {
diff --git a/MagickCore/studio.h b/MagickCore/studio.h
index c434028d7..6905a11fa 100644
--- a/MagickCore/studio.h
+++ b/MagickCore/studio.h
@@ -44,13 +44,10 @@ extern "C" {
 # define const  _magickcore_const
 #endif
 #if defined(_magickcore_inline) && !defined(inline)
 # define inline  _magickcore_inline
 #endif
-#if defined(_magickcore_restrict) && !defined(restrict)
-# define restrict  _magickcore_restrict
-#endif
 # if defined(__cplusplus) || defined(c_plusplus)
 #  undef inline
 # endif
 #endif
 
@@ -73,10 +70,13 @@ extern "C" {
 #else
 # if defined(MAGICKCORE_HAVE_STDLIB_H)
 #  include <stdlib.h>
 # endif
 #endif
+#if defined(_magickcore_restrict) && !defined(restrict)
+# define restrict  _magickcore_restrict
+#endif
 #if defined(MAGICKCORE_HAVE_STRING_H)
 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
 #  include <memory.h>
 # endif
 # include <string.h>
diff --git a/MagickCore/version.c b/MagickCore/version.c
index 36e5b5361..d4407437a 100644
--- a/MagickCore/version.c
+++ b/MagickCore/version.c
@@ -217,21 +217,30 @@ MagickExport const char *GetMagickDelegates(void)
 %
 */
 MagickExport const char *GetMagickFeatures(void)
 {
   return "DPC"
-#if defined(MAGICKCORE_BUILD_MODULES) || defined(_DLL)
-  " Modules"
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
+  " Debug"
+#endif
+#if defined(MAGICKCORE_CIPHER_SUPPORT)
+  " Cipher"
 #endif
 #if defined(MAGICKCORE_HDRI_SUPPORT)
   " HDRI"
 #endif
+#if defined(MAGICKCORE_BUILD_MODULES) || defined(_DLL)
+  " Modules"
+#endif
 #if defined(MAGICKCORE_OPENCL_SUPPORT)
   " OpenCL"
 #endif
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   " OpenMP"
+#endif
+#if defined(ZERO_CONFIGURATION_SUPPORT)
+  " Zero-configuration"
 #endif
   ;
 }
 
 /*
diff --git a/MagickCore/version.h b/MagickCore/version.h
index 7aa97dc01..f5221f15c 100644
--- a/MagickCore/version.h
+++ b/MagickCore/version.h
@@ -25,11 +25,11 @@ extern "C" {
 /*
   Define declarations.
 */
 #define MagickPackageName "ImageMagick"
 #define MagickCopyright  "Copyright (C) 1999-2015 ImageMagick Studio LLC"
-#define MagickSVNRevision  "18658:18662M"
+#define MagickSVNRevision  "18670M"
 #define MagickLibVersion  0x700
 #define MagickLibVersionText  "7.0.0"
 #define MagickLibVersionNumber  0,0,0
 #define MagickLibAddendum  "-0"
 #define MagickLibInterface  0
@@ -46,16 +46,16 @@ extern "C" {
 #define MagickppLibVersionText  "7.0.0"
 #define MagickppLibVersionNumber  0:0:0
 #define MagickppLibAddendum  "-0"
 #define MagickppLibInterface  0
 #define MagickppLibMinInterface  0
-#define MagickReleaseDate  "2015-05-26"
+#define MagickReleaseDate  "2015-05-29"
 #define MagickChangeDate   "20120427"
 #define MagickAuthoritativeLicense  \
   "http://www.imagemagick.org/script/license.php"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
-#define MagickFeatures "DPC HDRI OpenMP"
+#define MagickFeatures "DPC HDRI Cipher OpenMP"
 #define MagickDelegates "bzlib djvu mpeg fftw fpx fontconfig freetype jbig jng jpeg lcms lzma openexr pango png ps tiff webp x xml zlib"
 #define MagickHomeURL  "file:///usr/local/share/doc/ImageMagick-7/index.html"
 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
 #define MagickQuantumDepth  "Q8"
 #define MagickQuantumRange  "255"
diff --git a/MagickWand/studio.h b/MagickWand/studio.h
index b463d0a9b..7bf0aa3a1 100644
--- a/MagickWand/studio.h
+++ b/MagickWand/studio.h
@@ -44,13 +44,10 @@ extern "C" {
 # define const _magickcore_const
 #endif
 #if defined(_magickcore_inline) && !defined(inline)
 # define inline _magickcore_inline
 #endif
-#if defined(_magickcore_restrict) && !defined(restrict)
-# define restrict  _magickcore_restrict
-#endif
 # if defined(__cplusplus) || defined(c_plusplus)
 #  undef inline
 # endif
 #endif
 
@@ -75,10 +72,13 @@ extern "C" {
 #else
 # if defined(MAGICKCORE_HAVE_STDLIB_H)
 #  include <stdlib.h>
 # endif
 #endif
+#if defined(_magickcore_restrict) && !defined(restrict)
+# define restrict  _magickcore_restrict
+#endif
 #if defined(MAGICKCORE_HAVE_STRING_H)
 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
 #  include <memory.h>
 # endif
 # include <string.h>
diff --git a/coders/icon.c b/coders/icon.c
index 94c31e6b8..222dec254 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -181,12 +181,12 @@ Image *AutoResizeImage(const Image *image,const char *option,
 
     while ((isspace((int) ((unsigned char) *p)) != 0))
       p++;
 
     size=(size_t)strtol(p,&q,10);
-    if (p == q || size < 16 || size > 256)
-        return((Image *) NULL);
+    if ((p == q) || (size < 16) || (size > 256))
+      return((Image *) NULL);
 
     p=q;
     sizes[i++]=size;
 
     while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))
@@ -352,10 +352,12 @@ static Image *ReadICONImage(const ImageInfo *image_info,
 
         /*
           Icon image encoded as a compressed PNG image.
         */
         length=icon_file.directory[i].size;
+        if (~length < 16)
+          ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         png=(unsigned char *) AcquireQuantumMemory(length+16,sizeof(*png));
         if (png == (unsigned char *) NULL)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         (void) CopyMagickMemory(png,"\211PNG\r\n\032\n\000\000\000\015",12);
         png[12]=(unsigned char) icon_info.planes;
diff --git a/coders/pict.c b/coders/pict.c
index 4f51eb393..027119d81 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -1635,10 +1635,11 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
     x;
 
   size_t
     bytes_per_line,
     count,
+    row_bytes,
     storage_class;
 
   ssize_t
     y;
 
@@ -1647,11 +1648,10 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
     *packed_scanline,
     *scanline;
 
   unsigned short
     base_address,
-    row_bytes,
     transfer_mode;
 
   /*
     Open output image file.
   */
@@ -1679,11 +1679,11 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
   frame_rectangle=size_rectangle;
   crop_rectangle=size_rectangle;
   source_rectangle=size_rectangle;
   destination_rectangle=size_rectangle;
   base_address=0xff;
-  row_bytes=(unsigned short) (image->columns | 0x8000);
+  row_bytes=image->columns;
   bounds.top=0;
   bounds.left=0;
   bounds.bottom=(short) image->rows;
   bounds.right=(short) image->columns;
   pixmap.version=0;
@@ -1709,11 +1709,11 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
       pixmap.component_count=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
       pixmap.pixel_type=16;
       pixmap.bits_per_pixel=32;
       pixmap.pack_type=0x04;
       transfer_mode=0x40;
-      row_bytes=(unsigned short) ((4*image->columns) | 0x8000);
+      row_bytes=4*image->columns;
     }
   /*
     Allocate memory.
   */
   bytes_per_line=image->columns;
diff --git a/configure b/configure
index f1bfd46bc..7633dd204 100755
--- a/configure
+++ b/configure
@@ -4339,11 +4339,11 @@ MAGICK_MICRO_VERSION=0
 
 MAGICK_PATCHLEVEL_VERSION=0
 
 MAGICK_VERSION=7.0.0-0
 
-MAGICK_SVN_REVISION=18658:18662M
+MAGICK_SVN_REVISION=18670M
 
 
 # Substitute library versioning
 MAGICK_LIBRARY_CURRENT_MIN=`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`
 
@@ -21653,10 +21653,11 @@ fi
 
 if test "$enable_cipher" = 'yes'; then
 
 $as_echo "#define CIPHER_SUPPORT 1" >>confdefs.h
 
+    MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
 fi
 
 # Build a zero-configuration version of ImageMagick.
 # Check whether --enable-zero-configuration was given.
 if test "${enable_zero_configuration+set}" = set; then :
@@ -21668,11 +21669,11 @@ fi
 
 if test "$enable_zero_configuration" = 'yes'; then
 
 $as_echo "#define ZERO_CONFIGURATION_SUPPORT 1" >>confdefs.h
 
-    MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
+    MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
 fi
 
 # Build a high dynamic range version of ImageMagick.
 # Check whether --enable-hdri was given.
 if test "${enable_hdri+set}" = set; then :
@@ -36533,11 +36534,11 @@ fi
 #
 
 if test "$build_modules" != 'no'; then
     MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
 else
-    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $OPENJPEG_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
+    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIB $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
 fi
 
 
 #
 # Remove extraneous spaces from output variables (asthetic)
diff --git a/configure.ac b/configure.ac
index 5d2cb8a13..ba0e11186 100755
--- a/configure.ac
+++ b/configure.ac
@@ -640,10 +640,11 @@ AC_ARG_ENABLE([cipher],
     [enable_cipher=$enableval],
     [enable_cipher='yes'])
 
 if test "$enable_cipher" = 'yes'; then
     AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
+    MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
 fi
 
 # Build a zero-configuration version of ImageMagick.
 AC_ARG_ENABLE([zero-configuration],
     [AC_HELP_STRING([--enable-zero-configuration],
@@ -651,11 +652,11 @@ AC_ARG_ENABLE([zero-configuration],
     [enable_zero_configuration=$enableval],
     [enable_zero_configuration='no'])
 
 if test "$enable_zero_configuration" = 'yes'; then
     AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
-    MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
+    MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
 fi
 
 # Build a high dynamic range version of ImageMagick.
 AC_ARG_ENABLE([hdri],
     [AC_HELP_STRING([--enable-hdri],
@@ -3994,11 +3995,11 @@ fi
 #
 
 if test "$build_modules" != 'no'; then
     MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
 else
-    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $OPENJPEG_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
+    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIB $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
 fi
 AC_SUBST(MAGICK_DEP_LIBS)
 
 #
 # Remove extraneous spaces from output variables (asthetic)

Vulnerable code:   if (memory_info->blob == NULL)
      if (file != -1)
          if ((lseek(file,length-1,SEEK_SET) >= 0) && (write(file,"",1) == 1))
              memory_info->blob=MapBlob(file,IOMode,0,length);
              if (memory_info->blob != NULL)
                  memory_info->type=MapVirtualMemory;
                  (void) AcquireMagickResource(MapResource,length);
          (void) RelinquishUniqueFileResource(memory_info->filename);
#if defined(_magickcore_restrict) && !defined(restrict)
# define restrict  _magickcore_restrict
#endif
#if defined(MAGICKCORE_BUILD_MODULES) || defined(_DLL)
  " Modules"
#define MagickSVNRevision  "18658:18662M"
#define MagickReleaseDate  "2015-05-26"
#define MagickFeatures "DPC HDRI OpenMP"
#if defined(_magickcore_restrict) && !defined(restrict)
# define restrict  _magickcore_restrict
#endif
    if (p == q || size < 16 || size > 256)
        return((Image *) NULL);
    row_bytes,
  row_bytes=(unsigned short) (image->columns | 0x8000);
      row_bytes=(unsigned short) ((4*image->columns) | 0x8000);
MAGICK_SVN_REVISION=18658:18662M
    MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $OPENJPEG_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
    MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $OPENJPEG_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
Fixed code:   if ((memory_info->blob == NULL) &&
      (AcquireMagickResource(DiskResource,length) != MagickFalse))
      if (file == -1)
        RelinquishMagickResource(DiskResource,length);
      else
          if ((lseek(file,length-1,SEEK_SET) < 0) || (write(file,"",1) != 1))
            RelinquishMagickResource(DiskResource,length);
          else
              if (AcquireMagickResource(MapResource,length) == MagickFalse)
                RelinquishMagickResource(DiskResource,length);
              else
                  memory_info->blob=MapBlob(file,IOMode,0,length);
                  if (memory_info->blob != NULL)
                    memory_info->type=MapVirtualMemory;
                  else
                    {
                      RelinquishMagickResource(MapResource,length);
                      RelinquishMagickResource(DiskResource,length);
                    }
          {
            (void) RelinquishUniqueFileResource(memory_info->filename);
            RelinquishMagickResource(DiskResource,memory_info->length);
          }
#if defined(_magickcore_restrict) && !defined(restrict)
# define restrict  _magickcore_restrict
#endif
#if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
  " Debug"
#endif
#if defined(MAGICKCORE_CIPHER_SUPPORT)
  " Cipher"
#if defined(MAGICKCORE_BUILD_MODULES) || defined(_DLL)
  " Modules"
#endif
#endif
#if defined(ZERO_CONFIGURATION_SUPPORT)
  " Zero-configuration"
#define MagickSVNRevision  "18670M"
#define MagickReleaseDate  "2015-05-29"
#define MagickFeatures "DPC HDRI Cipher OpenMP"
#if defined(_magickcore_restrict) && !defined(restrict)
# define restrict  _magickcore_restrict
#endif
    if ((p == q) || (size < 16) || (size > 256))
      return((Image *) NULL);
        if (~length < 16)
          ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
    row_bytes,
  row_bytes=image->columns;
      row_bytes=4*image->columns;
MAGICK_SVN_REVISION=18670M
    MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
    MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIB $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
    MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
    MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
    MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIB $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"