From 6a7c0c1f684319915bb9380e69560d1a3edcc61c Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 15 Jul 2017 08:56:37 -0400 Subject: [PATCH] ... --- MagickCore/magick-type.h | 6 +++--- MagickCore/memory.c | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/MagickCore/magick-type.h b/MagickCore/magick-type.h index 8cd4f4a52..12dc09881 100644 --- a/MagickCore/magick-type.h +++ b/MagickCore/magick-type.h @@ -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. diff --git a/MagickCore/memory.c b/MagickCore/memory.c index d516b1e73..2713260f4 100644 --- a/MagickCore/memory.c +++ b/MagickCore/memory.c @@ -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); -- 2.40.0