]> granicus.if.org Git - imagemagick/commitdiff
Only resize in SetStringInfoLength when the length is different.
authordirk <dirk@git.imagemagick.org>
Sun, 21 Aug 2016 13:39:22 +0000 (15:39 +0200)
committerdirk <dirk@git.imagemagick.org>
Sun, 21 Aug 2016 13:39:22 +0000 (15:39 +0200)
MagickCore/string.c

index 2f4998884f050a21a795f3017d3643970cff9816..90da9cdb7700a5d488bce9e8c5e3dd2ce664e9da 100644 (file)
@@ -1780,6 +1780,8 @@ MagickExport void SetStringInfoLength(StringInfo *string_info,
 {
   assert(string_info != (StringInfo *) NULL);
   assert(string_info->signature == MagickCoreSignature);
+  if (string_info->length == length)
+    return;
   if (~length < MagickPathExtent)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   string_info->length=length;