]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 28 Jul 2013 20:14:08 +0000 (20:14 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 28 Jul 2013 20:14:08 +0000 (20:14 +0000)
MagickCore/memory.c

index 40366f571de7c3fb553df16d83e2420cc31700d3..aa5cea16292681e5d688e6db74cdc7dc64a728a6 100644 (file)
@@ -572,7 +572,9 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
       */
       memory_info->mapped=MagickTrue;
       memory_info->blob=MapBlob(-1,IOMode,0,length);
-      if (memory_info->blob == NULL)
+      if (memory_info->blob != NULL)
+        memory_info->mapped=MagickTrue;
+      else
         RelinquishMagickResource(MapResource,length);
     }
   if (memory_info->blob == NULL)
@@ -588,10 +590,12 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
         {
           if ((lseek(file,length-1,SEEK_SET) >= 0) && (write(file,"",1) == 1))
             {
-              memory_info->mapped=MagickTrue;
               memory_info->blob=MapBlob(file,IOMode,0,length);
               if (memory_info->blob != NULL)
-                (void) AcquireMagickResource(MapResource,length);
+                {
+                  memory_info->mapped=MagickTrue;
+                  (void) AcquireMagickResource(MapResource,length);
+                }
             }
           (void) close(file);
         }