Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Update ImageMagick from 7.1.1-20 -> 7.1.1-21
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored and MolotovCherry committed Oct 22, 2023
1 parent e5bb198 commit be01aae
Show file tree
Hide file tree
Showing 643 changed files with 288 additions and 264 deletions.
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OPENCL_INCLUDE_PATH := $(OPENCL_PATH)/qualcomm/include

LTDL_LIB_PATH := $(LOCAL_PATH)/libltdl-2.4.6

IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-20
IMAGE_MAGICK_BASEDIR := ImageMagick-7.1.1-21
IMAGE_MAGICK := $(LOCAL_PATH)/$(IMAGE_MAGICK_BASEDIR)

JPEG_LIB_PATH := $(LOCAL_PATH)/libjpeg-turbo-2.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1688,29 +1688,25 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone,

MagickBooleanType
destroy,
status;
status = MagickTrue;

static MagickSizeType
cpu_throttle = MagickResourceInfinity,
cycles = 0;

status=MagickTrue;
if (cpu_throttle == MagickResourceInfinity)
cpu_throttle=GetMagickResourceLimit(ThrottleResource);
if ((cycles++ % 4096) == 0)
if (difftime(GetMagickTime(),image->timestamp) > (double) image->ttl)
{
if (GetMagickTTL() <= 0)
{
cache_info=(CacheInfo *) image->cache;
if (cache_info->file != -1)
(void) ClosePixelCacheOnDisk(cache_info);
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitFatalError,"TimeLimitExceeded","`%s'",image->filename);
return((Cache) NULL);
}
if (cpu_throttle != 0)
MagickDelay(cpu_throttle);
cache_info=(CacheInfo *) image->cache;
if (cache_info->file != -1)
(void) ClosePixelCacheOnDisk(cache_info);
(void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitFatalError,"TimeLimitExceeded","`%s'",image->filename);
return((Cache) NULL);
}
if (cpu_throttle == MagickResourceInfinity)
cpu_throttle=GetMagickResourceLimit(ThrottleResource);
if ((cpu_throttle != 0) && ((cycles++ % 4096) == 0))
MagickDelay(cpu_throttle);
LockSemaphoreInfo(image->semaphore);
assert(image->cache != (Cache) NULL);
cache_info=(CacheInfo *) image->cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% March 2003 %
% %
% %
% Copyright @ 2003 ImageMagick Studio LLC, a non-profit organization %
% Copyright @ 1999 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. You may %
Expand Down Expand Up @@ -59,6 +59,7 @@
#include "MagickCore/splay-tree.h"
#include "MagickCore/statistic.h"
#include "MagickCore/string_.h"
#include "MagickCore/timer-private.h"

#if defined(MAGICKCORE_CIPHER_SUPPORT)
/*
Expand All @@ -80,7 +81,9 @@ typedef struct _AESInfo
*decipher_key;

ssize_t
rounds,
rounds;

time_t
timestamp;

size_t
Expand Down Expand Up @@ -203,7 +206,7 @@ static AESInfo *AcquireAESInfo(void)
(aes_info->encipher_key == (unsigned int *) NULL) ||
(aes_info->decipher_key == (unsigned int *) NULL))
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
aes_info->timestamp=(ssize_t) time(0);
aes_info->timestamp=GetMagickTime();
aes_info->signature=MagickCoreSignature;
return(aes_info);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,18 +1017,20 @@ static MagickBooleanType CompositeOverImage(Image *image,
{
if (y < y_offset)
continue;
if ((y-y_offset) >= (ssize_t) source_image->rows)
if ((y-(double) y_offset) >= (double) source_image->rows)
continue;
}
/*
If pixels is NULL, y is outside overlay region.
*/
pixels=(Quantum *) NULL;
p=(Quantum *) NULL;
if ((y >= y_offset) && ((y-y_offset) < (ssize_t) source_image->rows))
if ((y >= y_offset) &&
((y-(double) y_offset) < (double) source_image->rows))
{
p=GetCacheViewVirtualPixels(source_view,0,y-y_offset,
source_image->columns,1,exception);
p=GetCacheViewVirtualPixels(source_view,0,
CastDoubleToLong(y-(double) y_offset),source_image->columns,1,
exception);
if (p == (const Quantum *) NULL)
{
status=MagickFalse;
Expand Down Expand Up @@ -1073,11 +1075,11 @@ static MagickBooleanType CompositeOverImage(Image *image,
q+=GetPixelChannels(image);
continue;
}
if ((x-x_offset) >= (ssize_t) source_image->columns)
if ((x-(double) x_offset) >= (double) source_image->columns)
break;
}
if ((pixels == (Quantum *) NULL) || (x < x_offset) ||
((x-x_offset) >= (ssize_t) source_image->columns))
((x-(double) x_offset) >= (double) source_image->columns))
{
Quantum
source[MaxPixelChannels];
Expand All @@ -1087,8 +1089,9 @@ static MagickBooleanType CompositeOverImage(Image *image,
Sc: source color.
Dc: canvas color.
*/
(void) GetOneVirtualPixel(source_image,x-x_offset,y-y_offset,source,
exception);
(void) GetOneVirtualPixel(source_image,
CastDoubleToLong(x-(double) x_offset),
CastDoubleToLong(y-(double) y_offset),source,exception);
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
Expand Down Expand Up @@ -2304,18 +2307,20 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
{
if (y < y_offset)
continue;
if ((y-y_offset) >= (ssize_t) source_image->rows)
if ((y-(double) y_offset) >= (double) source_image->rows)
continue;
}
/*
If pixels is NULL, y is outside overlay region.
*/
pixels=(Quantum *) NULL;
p=(Quantum *) NULL;
if ((y >= y_offset) && ((y-y_offset) < (ssize_t) source_image->rows))
if ((y >= y_offset) &&
((y-(double) y_offset) < (double) source_image->rows))
{
p=GetCacheViewVirtualPixels(source_view,0,y-y_offset,
source_image->columns,1,exception);
p=GetCacheViewVirtualPixels(source_view,0,
CastDoubleToLong(y-(double) y_offset),source_image->columns,1,
exception);
if (p == (const Quantum *) NULL)
{
status=MagickFalse;
Expand Down Expand Up @@ -2351,24 +2356,24 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
Sca = 0.0,
Si = 0.0;

ssize_t
i;

size_t
channels;

ssize_t
i;

if (clip_to_self != MagickFalse)
{
if (x < x_offset)
{
q+=GetPixelChannels(image);
continue;
}
if ((x-x_offset) >= (ssize_t) source_image->columns)
if ((x-(double) x_offset) >= (double) source_image->columns)
break;
}
if ((pixels == (Quantum *) NULL) || (x < x_offset) ||
((x-x_offset) >= (ssize_t) source_image->columns))
((x-(double) x_offset) >= (double) source_image->columns))
{
Quantum
source[MaxPixelChannels];
Expand All @@ -2378,8 +2383,9 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
Sc: source color.
Dc: canvas color.
*/
(void) GetOneVirtualPixel(source_image,x-x_offset,y-y_offset,source,
exception);
(void) GetOneVirtualPixel(source_image,
CastDoubleToLong(x-(double) x_offset),
CastDoubleToLong(y-(double) y_offset),source,exception);
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
#include "MagickCore/statistic.h"
#include "MagickCore/statistic-private.h"
#include "MagickCore/string_.h"
#include "MagickCore/timer-private.h"
#include "MagickCore/thread-private.h"
#include "MagickCore/threshold.h"
#include "MagickCore/timer-private.h"
#include "MagickCore/token.h"
#include "MagickCore/transform.h"
#include "MagickCore/transform-private.h"
Expand Down Expand Up @@ -655,7 +655,6 @@ typedef struct {
fxFltType * ValStack;
fxFltType * UserSymVals;
Quantum * thisPixel;
MagickSizeType loopCount;
} fxRtT;

struct _FxInfo {
Expand Down Expand Up @@ -1000,8 +999,6 @@ static MagickBooleanType AllocFxRt (FxInfo * pfx, fxRtT * pfxrt)
for (i = 0; i < pfx->usedUserSymbols; i++) pfxrt->UserSymVals[i] = (fxFltType) 0;
}

pfxrt->loopCount = 0;

return MagickTrue;
}

Expand Down Expand Up @@ -3934,12 +3931,10 @@ static MagickBooleanType ExecuteRPN (FxInfo * pfx, fxRtT * pfxrt, fxFltType *res
case rGotoChk:
assert (pel->EleNdx >= 0);
i = pel->EleNdx-1; /* -1 because 'for' loop will increment. */
if ((pfxrt->loopCount++ % 8192) == 0) {
if (GetMagickTTL() <= 0) {
i = pfx->usedElements-1; /* Do no more opcodes. */
(void) ThrowMagickException (pfx->exception, GetMagickModule(),
ResourceLimitFatalError, "TimeLimitExceeded", "`%s'", img->filename);
}
if (difftime(GetMagickTime(),img->timestamp) > (double) img->ttl) {
i = pfx->usedElements-1; /* Do no more opcodes. */
(void) ThrowMagickException (pfx->exception, GetMagickModule(),
ResourceLimitFatalError, "TimeLimitExceeded", "`%s'", img->filename);
}
break;
case rIfZeroGoto:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static inline size_t CastDoubleToUnsigned(const double x)
errno=ERANGE;
return(0);
}
if (floor(x) > ((double) MAGICK_SSIZE_MAX-1))
if (floor(x) > ((double) MAGICK_SIZE_MAX-1))
{
errno=ERANGE;
return((size_t) MAGICK_SIZE_MAX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info,
image->channel_map=AcquirePixelChannelMap();
image->blob=CloneBlobInfo((BlobInfo *) NULL);
image->timestamp=GetMagickTime();
image->ttl=(time_t) GetMagickResourceLimit(TimeResource);
image->debug=(GetLogEventMask() & (ImageEvent | TransformEvent | CoderEvent))
!= 0 ? MagickTrue : MagickFalse;
image->reference_count=1;
Expand Down Expand Up @@ -857,6 +858,8 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns,
clone_image->blob=CloneBlobInfo((BlobInfo *) NULL);
}
clone_image->ping=image->ping;
clone_image->timestamp=image->timestamp;
clone_image->ttl=image->ttl;
clone_image->debug=image->debug;
clone_image->semaphore=AcquireSemaphoreInfo();
if (image->colormap != (PixelInfo *) NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ struct _Image

ChannelType
channels;

time_t
ttl;
};

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,6 @@ MagickExport void MagickCoreGenesis(const char *path,
#endif
(void) RegistryComponentGenesis();
(void) MonitorComponentGenesis();
(void) GetMagickTTL();
magickcore_instantiated=MagickTrue;
UnlockMagickMutex();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/timer-private.h"
#include "MagickCore/token.h"
#include "MagickCore/utility.h"
#include "MagickCore/utility-private.h"
Expand Down Expand Up @@ -147,7 +148,7 @@ MagickExport ModuleInfo *AcquireModuleInfo(const char *path,const char *tag)
module_info->path=ConstantString(path);
if (tag != (const char *) NULL)
module_info->tag=ConstantString(tag);
module_info->timestamp=time(0);
module_info->timestamp=GetMagickTime();
module_info->signature=MagickCoreSignature;
return(module_info);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,12 +987,10 @@ static int NTLocateGhostscript(DWORD flags,int *root_index,
status;

static const char
*products[4] =
*products[2] =
{
"GPL Ghostscript",
"GNU Ghostscript",
"AFPL Ghostscript",
"Aladdin Ghostscript"
"Artifex Ghostscript",
"GPL Ghostscript"
};

/*
Expand Down
Loading

0 comments on commit be01aae

Please sign in to comment.