From: Juha-Pekka Heikkila Date: Fri, 7 Feb 2014 12:44:05 +0000 (+0200) Subject: egl: Unhide functionality in _eglInitSurface() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=498d10e230663f8604d00608cae6324f779c9cdd;p=mesa.git egl: Unhide functionality in _eglInitSurface() _eglInitResource() was used to memset entire _EGLSurface by writing more than size of pointed target. This does work as long as Resource is the first element in _EGLSurface, this patch fixes such dependency. Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Brian Paul --- diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c index c5ea2245b3d..1dca3e06876 100644 --- a/src/egl/main/eglsurface.c +++ b/src/egl/main/eglsurface.c @@ -314,7 +314,9 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type, return EGL_FALSE; } - _eglInitResource(&surf->Resource, sizeof(*surf), dpy); + + memset(surf, 0, sizeof(_EGLSurface)); + _eglInitResource(&surf->Resource, sizeof(_EGLResource), dpy); surf->Type = type; surf->Config = conf;