]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 15 Jul 2017 12:56:37 +0000 (08:56 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 15 Jul 2017 12:56:37 +0000 (08:56 -0400)
MagickCore/magick-type.h
MagickCore/memory.c

index 8cd4f4a52900ab60f61a0e597b760c3e0862d434..12dc098813fd86677406dcfcab55ee720abd6306 100644 (file)
@@ -1,12 +1,12 @@
 /*
   Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
-  
+
   You may not use this file except in compliance with the License.
   obtain a copy of the License at
-  
+
     https://www.imagemagick.org/script/license.php
-  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index d516b1e7316ecd74cb3f510b313789c091b63237..2713260f4c973b86a371d36736579a83adf49dea 100644 (file)
@@ -660,7 +660,6 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
                 offset;
 
               offset=(MagickOffsetType) lseek(file,extent-1,SEEK_SET);
-              (void) close(file);
               if ((offset == (MagickOffsetType) (extent-1)) &&
                   (write(file,"",1) == 1))
                 {
@@ -674,9 +673,16 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,
                       *memory_info->filename='\0';
                     }
                 }
+              (void) close(file);
             }
         }
     }
+  if (memory_info->blob == NULL)
+    {
+      memory_info->blob=AcquireQuantumMemory(1,extent);
+      if (memory_info->blob != NULL)
+        memory_info->type=UnalignedVirtualMemory;
+    }
   if (memory_info->blob == NULL)
     memory_info=RelinquishVirtualMemory(memory_info);
   return(memory_info);