From 41dc8bf5095aeaf6bb6786fb729471ce24173dd3 Mon Sep 17 00:00:00 2001 From: dirk Date: Fri, 15 Apr 2016 11:32:46 +0200 Subject: [PATCH] An exception should be thrown when resize methods are called with invalid arguments. --- MagickCore/resize.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MagickCore/resize.c b/MagickCore/resize.c index c5fc90cc8..2d2c94c0b 100644 --- a/MagickCore/resize.c +++ b/MagickCore/resize.c @@ -1701,7 +1701,7 @@ MagickExport Image *InterpolativeResizeImage(const Image *image, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); if ((columns == 0) || (rows == 0)) - return((Image *) NULL); + ThrowImageException(ImageError,"NegativeOrZeroImageSize"); if ((columns == image->columns) && (rows == image->rows)) return(CloneImage(image,0,0,MagickTrue,exception)); resize_image=CloneImage(image,columns,rows,MagickTrue,exception); @@ -1878,7 +1878,7 @@ MagickExport Image *LiquidRescaleImage(const Image *image,const size_t columns, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); if ((columns == 0) || (rows == 0)) - return((Image *) NULL); + ThrowImageException(ImageError,"NegativeOrZeroImageSize"); if ((columns == image->columns) && (rows == image->rows)) return(CloneImage(image,0,0,MagickTrue,exception)); if ((columns <= 2) || (rows <= 2)) @@ -3224,7 +3224,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); if ((columns == 0) || (rows == 0)) - return((Image *) NULL); + ThrowImageException(ImageError,"NegativeOrZeroImageSize"); if ((columns == image->columns) && (rows == image->rows)) return(CloneImage(image,0,0,MagickTrue,exception)); scale_image=CloneImage(image,columns,rows,MagickTrue,exception); -- 2.40.0