From: dirk Date: Fri, 15 Apr 2016 09:32:46 +0000 (+0200) Subject: An exception should be thrown when resize methods are called with invalid arguments. X-Git-Tag: 7.0.1-0~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41dc8bf5095aeaf6bb6786fb729471ce24173dd3;p=imagemagick An exception should be thrown when resize methods are called with invalid arguments. --- 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);