From: Cristy Date: Thu, 29 Nov 2018 19:16:09 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.8-15~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31d3d7cbf0da7d3d4a00593547af39ebecd5f57e;p=imagemagick ... --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 58006516e..56407b9c4 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -652,8 +652,8 @@ MagickExport MagickBooleanType CLAHEImage(Image *image,const size_t x_tiles, 1 : x_tiles); tile.y=(ssize_t) (y_tiles < 2 ? 2 : y_tiles >= MaxCLAHETiles ? MaxCLAHETiles- 1 : y_tiles); - width=((image->columns+tile.x/2)/tile.x)*tile.x; - height=((image->rows+tile.y/2)/tile.y)*tile.y; + width=((image->columns+tile.x/2+1)/tile.x)*tile.x; + height=((image->rows+tile.y/2+1)/tile.y)*tile.y; pixel_cache=AcquireVirtualMemory(width,height*sizeof(*pixels)); if (pixel_cache == (MemoryInfo *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",