Skip to content

Commit

Permalink
Fix the max memory request initial value in memory.c and comparison i…
Browse files Browse the repository at this point in the history
…n jpeg.c (#251)
  • Loading branch information
drivron authored Jun 24, 2023
1 parent 06c822f commit 60a877e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions coders/jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
#include "magick/token.h"
#include "magick/utility.h"
#include "magick/xml-tree.h"
#include <limits.h>
#include <setjmp.h>
#if defined(MAGICKCORE_JPEG_DELEGATE)
#define JPEG_INTERNAL_OPTIONS
Expand Down
4 changes: 2 additions & 2 deletions magick/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ MagickExport size_t GetMaxMemoryRequest(void)
char
*value;

max_memory_request=(size_t) MagickULLConstant(~0);
max_memory_request=(size_t) MAGICK_SSIZE_MAX;
value=GetPolicyValue("system:max-memory-request");
if (value != (char *) NULL)
{
Expand All @@ -1063,7 +1063,7 @@ MagickExport size_t GetMaxMemoryRequest(void)
value=DestroyString(value);
}
}
return(MagickMin(max_memory_request,MAGICK_SSIZE_MAX));
return(MagickMin(max_memory_request,(size_t) MAGICK_SSIZE_MAX));
}

/*
Expand Down

0 comments on commit 60a877e

Please sign in to comment.