]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1763
authorCristy <urban-warrior@imagemagick.org>
Fri, 25 Oct 2019 15:56:55 +0000 (11:56 -0400)
committerCristy <urban-warrior@imagemagick.org>
Fri, 25 Oct 2019 15:56:55 +0000 (11:56 -0400)
coders/ps.c

index af69804c23a0fc46bc8baff2a889d280f3814c10..5981d925c0708f7943a01f6eb0b737144dafb699 100644 (file)
@@ -628,9 +628,9 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
         info.bounds.x1,info.bounds.y1);
       (void) SetImageProperty(image,"ps:HiResBoundingBox",geometry,exception);
       page.width=(size_t) ceil((double) ((info.bounds.x2-info.bounds.x1)*
-        resolution.x/delta.x)-0.5);
+        MagickMax(resolution.x/delta.x,0.0))-0.5);
       page.height=(size_t) ceil((double) ((info.bounds.y2-info.bounds.y1)*
-        resolution.y/delta.y)-0.5);
+        MagickMax(resolution.y/delta.y,0.0))-0.5);
     }
   fitPage=MagickFalse;
   option=GetImageOption(image_info,"eps:fit-page");