[Beignet] [PATCH 1/2] Runtime: fix a null reference bug.
Yang, Rong R
rong.r.yang at intel.com
Tue Sep 17 23:32:38 PDT 2013
LGTM, test pass, thanks.
-----Original Message-----
From: beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org [mailto:beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Tuesday, September 17, 2013 5:56 PM
To: beignet at lists.freedesktop.org
Subject: Re: [Beignet] [PATCH 1/2] Runtime: fix a null reference bug.
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
More information about the Beignet
mailing list