[Beignet] [PATCH 1/2] Runtime: fix a null reference bug.
Zhigang Gong
zhigang.gong at linux.intel.com
Tue Sep 17 02:55:59 PDT 2013
Please ignore the previous version and use the attached version instead.
As it's conflict with one of Rong's patch.
On Fri, Sep 13, 2013 at 04:55:22PM +0800, Zhigang Gong wrote:
> The image_slice_pitch may be a null pointer. Need to check before refer
> it.
>
> Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
> ---
> src/cl_api.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/cl_api.c b/src/cl_api.c
> index 7078118..f194760 100644
> --- a/src/cl_api.c
> +++ b/src/cl_api.c
> @@ -2175,7 +2175,8 @@ clEnqueueMapImage(cl_command_queue command_queue,
> data->origin[0] = origin[0]; data->origin[1] = origin[1]; data->origin[2] = origin[2];
> data->region[0] = region[0]; data->region[1] = region[1]; data->region[2] = region[2];
> data->row_pitch = *image_row_pitch;
> - data->slice_pitch = *image_slice_pitch;
> + if (image_slice_pitch)
> + data->slice_pitch = *image_slice_pitch;
> data->ptr = ptr;
> data->offset = offset;
>
> --
> 1.7.9.5
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Runtime-prepare-for-CL_MEM_USE_HOST_PTR-for-image-su.patch
Type: text/x-diff
Size: 1111 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20130917/ed03658c/attachment.patch>
More information about the Beignet
mailing list