From: Cristy <urban-warrior@imagemagick.org>
Date: Thu, 16 Feb 2017 15:12:17 +0000 (-0500)
Subject: ...
X-Git-Tag: 7.0.4-10~5
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a210563970629abad7084490f7fea57f747aba55;p=imagemagick

...
---

diff --git a/MagickCore/cache.c b/MagickCore/cache.c
index fec196724..ded456ef2 100644
--- a/MagickCore/cache.c
+++ b/MagickCore/cache.c
@@ -3444,7 +3444,15 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
       cache_anonymous_memory=0;
       value=GetPolicyValue("pixel-cache-memory");
       if (LocaleCompare(value,"anonymous") == 0)
-        cache_anonymous_memory=1;
+        {
+#if defined(MAGICKCORE_HAVE_MMAP) && defined(MAP_ANONYMOUS)
+          cache_anonymous_memory=1;
+#else
+          (void) ThrowMagickException(exception,GetMagickModule(),
+            MissingDelegateError,"DelegateLibrarySupportNotBuiltIn",
+            "'%s' (policy requires anonymous memory mapping)",image->filename);
+#endif
+        }
       value=DestroyString(value);
     }
   if ((image->columns == 0) || (image->rows == 0))
@@ -4699,7 +4707,7 @@ static inline MagickBooleanType AcquireCacheNexusPixels(
       nexus_info->mapped=MagickFalse;
       nexus_info->cache=(Quantum *) MagickAssumeAligned(AcquireAlignedMemory(1,
         (size_t) nexus_info->length));
-      if (nexus_info->cache != (PixelPacket *) NULL)
+      if (nexus_info->cache != (Quantum *) NULL)
         ResetMagickMemory(nexus_info->cache,0,(size_t) nexus_info->length);
     }
   else