From: Dirk Lemstra Date: Fri, 14 Sep 2018 07:59:20 +0000 (+0200) Subject: Also call png_set_chunk_malloc_max when png:chunk-malloc-max is not set to avoid... X-Git-Tag: 7.0.8-12~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6f6f88ebaa2124475ced7b40a308cff0a65cdf4;p=imagemagick Also call png_set_chunk_malloc_max when png:chunk-malloc-max is not set to avoid low build in limit #1301. --- diff --git a/coders/png.c b/coders/png.c index 4ca72e9a6..01af8de27 100644 --- a/coders/png.c +++ b/coders/png.c @@ -68,6 +68,7 @@ #include "MagickCore/log.h" #include "MagickCore/MagickCore.h" #include "MagickCore/memory_.h" +#include "MagickCore/memory-private.h" #include "MagickCore/module.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" @@ -2449,6 +2450,8 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, if (option != (const char *) NULL) png_set_chunk_malloc_max(ping,(png_alloc_size_t) MagickMin(PNG_SIZE_MAX, StringToLong(option))); + else + png_set_chunk_malloc_max(ping,(png_alloc_size_t) GetMaxMemoryRequest()); #endif } #endif /* PNG_SET_USER_LIMITS_SUPPORTED */