Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12-SP2:GA
ImageMagick.29977
ImageMagick-CVE-2022-32546.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ImageMagick-CVE-2022-32546.patch of Package ImageMagick.29977
Index: ImageMagick-6.8.8-1/coders/pcl.c =================================================================== --- ImageMagick-6.8.8-1.orig/coders/pcl.c +++ ImageMagick-6.8.8-1/coders/pcl.c @@ -142,6 +142,18 @@ static MagickBooleanType IsPCL(const uns % o exception: return any errors or warnings in this structure. % */ +static inline ssize_t CastDoubleToLong(const double value) +{ + if (IsNaN(value) != 0) + return(0); + if (floor(value) > ((double) SSIZE_MAX-1)) + return((ssize_t) SSIZE_MAX); + if (ceil(value) < ((double) (-(SSIZE_MAX)-1))) + return((ssize_t) (-(SSIZE_MAX)-1)); + return((ssize_t) value); +} + + static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define CropBox "CropBox" @@ -293,8 +305,8 @@ static Image *ReadPCLImage(const ImageIn /* 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)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor