Aaron Watry <awa...@gmail.com> writes: > This should fix a segfault in the case that you're not using ocl-icd. > > If you're using ocl-icd, make sure your version is new enough or you'll get > the segfault before you even get to clover. > > The null de-ref seems to have been introduced in 10.1, but earlier versions > have have also been affected in other ways. >
NAK. The obj() function already checks if the pointer is NULL. Not sure how you're getting a segfault. > CC: "10.1" <mesa-sta...@lists.freedesktop.org> > > Signed-off-by: Aaron Watry <awa...@gmail.com> > --- > src/gallium/state_trackers/clover/api/memory.cpp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/gallium/state_trackers/clover/api/memory.cpp > b/src/gallium/state_trackers/clover/api/memory.cpp > index 7ed2191..dad5ad3 100644 > --- a/src/gallium/state_trackers/clover/api/memory.cpp > +++ b/src/gallium/state_trackers/clover/api/memory.cpp > @@ -32,6 +32,9 @@ clCreateBuffer(cl_context d_ctx, cl_mem_flags flags, size_t > size, > void *host_ptr, cl_int *r_errcode) try { > auto &ctx = obj(d_ctx); > > + if (d_ctx == NULL) > + throw error(CL_INVALID_CONTEXT); > + > if (bool(host_ptr) != bool(flags & (CL_MEM_USE_HOST_PTR | > CL_MEM_COPY_HOST_PTR))) > throw error(CL_INVALID_HOST_PTR); > -- > 1.8.3.2 > > _______________________________________________ > mesa-stable mailing list > mesa-sta...@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-stable
pgpUh2YjJFwLD.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev