Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Mar 19, 2022
1 parent ee332c5 commit 450949e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion coders/emf.c
Expand Up @@ -411,7 +411,8 @@ static HENHMETAFILE ReadEnhMetaFile(const char *path,ssize_t *width,
}
ReadFile(hFile,pBits,dwSize,&dwSize,NULL);
CloseHandle(hFile);
if (((PAPMHEADER) pBits)->dwKey != 0x9ac6cdd7l)
if (((PAPMHEADER) pBits)->dwKey != 0x9ac6cdd7l ||
(((PAPMHEADER) pBits)->wInch == 0))
{
pBits=(BYTE *) DestroyString((char *) pBits);
return((HENHMETAFILE) NULL);
Expand Down
5 changes: 3 additions & 2 deletions coders/psd.c
Expand Up @@ -1048,8 +1048,9 @@ static MagickBooleanType ReadPSDChannelPixels(Image *image,
number_bits=8;
for (bit=0; bit < number_bits; bit++)
{
SetPSDPixel(image,channels,type,packet_size,(((unsigned char) pixel)
& (0x01 << (7-bit))) != 0 ? 0 : QuantumRange,q++,indexes,x++);
SetPSDPixel(image,channels,type,packet_size,
(((unsigned char) ((ssize_t) pixel)) & (0x01 << (7-bit))) != 0 ? 0 :
QuantumRange,q++,indexes,x++);
}
if (x != (ssize_t) image->columns)
x--;
Expand Down
6 changes: 6 additions & 0 deletions magick/widget.c
Expand Up @@ -7861,6 +7861,8 @@ MagickExport int XMenuWidget(Display *display,XWindows *windows,
break;
}
state&=(~InactiveWidgetState);
if (selection_info.height == 0)
break;
id=(event.xbutton.y-top_offset)/(int) selection_info.height;
selection_info.id=id;
if ((id < 0) || (id >= (int) number_selections))
Expand Down Expand Up @@ -7914,6 +7916,8 @@ MagickExport int XMenuWidget(Display *display,XWindows *windows,
if (event.xcrossing.state == 0)
break;
state&=(~InactiveWidgetState);
if (selection_info.height == 0)
break;
id=((event.xcrossing.y-top_offset)/(int) selection_info.height);
if ((selection_info.id >= 0) &&
(selection_info.id < (int) number_selections))
Expand Down Expand Up @@ -8000,6 +8004,8 @@ MagickExport int XMenuWidget(Display *display,XWindows *windows,
break;
if (state & InactiveWidgetState)
break;
if (selection_info.height == 0)
break;
id=(event.xmotion.y-top_offset)/(int) selection_info.height;
if ((selection_info.id >= 0) &&
(selection_info.id < (int) number_selections))
Expand Down
5 changes: 4 additions & 1 deletion wand/animate.c
Expand Up @@ -1143,7 +1143,10 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info,
if (i == (ssize_t) argc)
ThrowAnimateException(OptionError,"MissingArgument",option);
if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
return(MagickFalse);
{
DestroyAnimate();
return(MagickFalse);
}
i--;
break;
}
Expand Down
5 changes: 4 additions & 1 deletion wand/display.c
Expand Up @@ -1491,7 +1491,10 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
if (i == (ssize_t) argc)
ThrowDisplayException(OptionError,"MissingArgument",option);
if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
return(MagickFalse);
{
DestroyDisplay();
return(MagickFalse);
}
i--;
break;
}
Expand Down

0 comments on commit 450949e

Please sign in to comment.