Skip to content

Commit

Permalink
constrain sub-image list
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Apr 9, 2021
1 parent 75c05e1 commit c4392ae
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions magick/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,24 +248,12 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes,

while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))
p++;
first=(ssize_t) strtol(p,&p,10);
if (first < 0)
first+=(ssize_t) length;
else
if (first > (ssize_t) length)
first=(ssize_t) length;
first=(ssize_t) strtol(p,&p,10) % (length << 1);
last=first;
while (isspace((int) ((unsigned char) *p)) != 0)
p++;
if (*p == '-')
{
last=(ssize_t) strtol(p+1,&p,10);
if (last < 0)
last+=(ssize_t) length;
else
if (last > (ssize_t) length)
last=(ssize_t) length;
}
last=(ssize_t) strtol(p+1,&p,10) % (length << 1);
match=MagickFalse;
step=1;
if (artifact != (const char *) NULL)
Expand Down

0 comments on commit c4392ae

Please sign in to comment.