On 05/30/2014 04:58 PM, Sinclair Yeh wrote: > We have customers using NULL as a way to test the robustness of > the API. Without this check, EGL will segfault trying to > dereference dri2_surf->wl_win->private because wl_win is > NULL.
It sounds like we need a piglit test for this... :) Should this check actually go at a higher level? It seems that other window system back-ends could have the same problem. > This fix adds a check and sets EGL_BAD_NATIVE_WINDOW It looks like this same code exists in the 10.2 branch and the 10.1 branch. This patch should be tagged with: Cc: "10.1 10.2" <mesa-sta...@lists.freedesktop.org> > --- > src/egl/drivers/dri2/platform_wayland.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/egl/drivers/dri2/platform_wayland.c > b/src/egl/drivers/dri2/platform_wayland.c > index 537d26e..66f51e9 100644 > --- a/src/egl/drivers/dri2/platform_wayland.c > +++ b/src/egl/drivers/dri2/platform_wayland.c > @@ -130,6 +130,13 @@ dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay > *disp, EGLint type, > > (void) drv; > > + if (NULL == window) > + { if (window == NULL) { > + _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface"); > + return NULL; > + } > + > + > dri2_surf = malloc(sizeof *dri2_surf); > if (!dri2_surf) { > _eglError(EGL_BAD_ALLOC, "dri2_create_surface"); > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev