Skip to content

Commit

Permalink
Fixes #4985: 4e+26 is outside the range of representable values of ty…
Browse files Browse the repository at this point in the history
…pe 'unsigned long' at coders/pcl.c:299 (#4986)

* fix Division by zero in XMenuWidget() of MagickCore/widget.c

* Fix memory leak in AnimateImageCommand() of MagickWand/animate.c and DisplayImageCommand() of MagickWand/display.c

* fix Division by zero in ReadEnhMetaFile() of coders/emf.c

* Resolve conflicts

* fix issue: outside the range of representable values of type 'unsigned char' at coders/psd.c:1025

* fix error: 4e+26 is outside the range of representable values of type 'unsigned long' at coders/pcl.c:299

Co-authored-by: zhailiangliang <zhailiangliang@loongson.cn>
  • Loading branch information
xiaoxiaoafeifei and xiaoxiaoafeifei committed Mar 24, 2022
1 parent 96162eb commit f221ea0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coders/pcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Set PCL render geometry.
*/
width=(size_t) floor(bounds.x2-bounds.x1+0.5);
height=(size_t) floor(bounds.y2-bounds.y1+0.5);
width=(size_t)CastDoubleToLong(floor(bounds.x2-bounds.x1+0.5));
height=(size_t)CastDoubleToLong(floor(bounds.y2-bounds.y1+0.5));
if (width > page.width)
page.width=width;
if (height > page.height)
Expand Down

0 comments on commit f221ea0

Please sign in to comment.