Skip to content

Commit

Permalink
support ICON size of 512 (ImageMagick/ImageMagick#7684)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Oct 13, 2024
1 parent a61d721 commit 8ba147b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions coders/icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ ModuleExport void UnregisterICONImage(void)
Image *AutoResizeImage(const Image *image,const char *option,
MagickOffsetType *count,ExceptionInfo *exception)
{
#define MAX_SIZES 16
#define MAX_SIZES 11

char
*q;
Expand All @@ -939,7 +939,7 @@ Image *AutoResizeImage(const Image *image,const char *option,
*images;

size_t
sizes[MAX_SIZES]={256, 192, 128, 96, 64, 48, 40, 32, 24, 16};
sizes[MAX_SIZES] = { 512, 256, 192, 128, 96, 64, 48, 40, 32, 24, 16 };

ssize_t
i;
Expand All @@ -956,15 +956,15 @@ Image *AutoResizeImage(const Image *image,const char *option,
while ((isspace((int) ((unsigned char) *p)) != 0))
p++;
size=(size_t)strtol(p,&q,10);
if ((p == q) || (size < 16) || (size > 256))
if ((p == q) || (size < 16) || (size > 512))
return((Image *) NULL);
p=q;
sizes[i++]=size;
while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))
p++;
}
if (i == 0)
i=10;
i=MAX_SIZES;
*count=i;
for (i=0; i < *count; i++)
{
Expand Down Expand Up @@ -1054,12 +1054,11 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
next=image;
do
{
if ((image->columns > 256L) || (image->rows > 256L))
if ((image->columns > 512L) || (image->rows > 512L))
ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
scene++;
next=SyncNextImageInList(next);
} while ((next != (Image *) NULL) && (image_info->adjoin !=
MagickFalse));
} while ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse));
}
/*
Dump out a ICON header template to be properly initialized later.
Expand Down

0 comments on commit 8ba147b

Please sign in to comment.