From: dirk Date: Sun, 27 Mar 2016 20:57:27 +0000 (+0200) Subject: Pixels should not be set to NULL we need it later in copyWriteBuffer. X-Git-Tag: 7.0.1-0~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90d23430e9bb2b556df7150e6cdfc1126c8b5374;p=imagemagick Pixels should not be set to NULL we need it later in copyWriteBuffer. --- diff --git a/MagickCore/accelerate.c b/MagickCore/accelerate.c index 49937967b..76e4940e7 100644 --- a/MagickCore/accelerate.c +++ b/MagickCore/accelerate.c @@ -294,6 +294,9 @@ static cl_mem createBuffer(const Image *image,CacheView *image_view, size_t length; + void + *hostPtr; + pixels=(void *) GetCacheViewVirtualPixels(image_view,0,0,image->columns, image->rows,exception); if (pixels == (void *) NULL) @@ -304,16 +307,17 @@ static cl_mem createBuffer(const Image *image,CacheView *image_view, } mem_flags=flags; + hostPtr=pixels; if (ALIGNED(pixels,CLQuantum)) mem_flags=mem_flags | CL_MEM_USE_HOST_PTR; else if ((mem_flags == CL_MEM_READ_ONLY) || (mem_flags == CL_MEM_READ_WRITE)) mem_flags=mem_flags | CL_MEM_COPY_HOST_PTR; else if (mem_flags == CL_MEM_WRITE_ONLY) - pixels=NULL; + hostPtr=NULL; length=image->columns*image->rows*image->number_channels; buffer=clEnv->library->clCreateBuffer(context,mem_flags,length* - sizeof(CLQuantum),pixels,&status); + sizeof(CLQuantum),hostPtr,&status); if (status != CL_SUCCESS) { (void) OpenCLThrowMagickException(exception,GetMagickModule(),