]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Thu, 16 Feb 2017 15:12:17 +0000 (10:12 -0500)
committerCristy <urban-warrior@imagemagick.org>
Thu, 16 Feb 2017 15:12:17 +0000 (10:12 -0500)
MagickCore/cache.c

index fec196724d07a23d1c40f2f0d3d2a502c4cfac62..ded456ef23d3f1da6b50b2ca9d79602bc8451bd4 100644 (file)
@@ -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