From e6f6f88ebaa2124475ced7b40a308cff0a65cdf4 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 14 Sep 2018 09:59:20 +0200 Subject: [PATCH] Also call png_set_chunk_malloc_max when png:chunk-malloc-max is not set to avoid low build in limit #1301. --- coders/png.c | 3 +++ 1 file changed, 3 insertions(+) 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 */ -- 2.40.0