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 <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Juha-Pekka Heikkila
2014-02-07 14:44:05 +02:00
committed by Brian Paul
parent 1456ed85f0
commit 498d10e230
+3 -1
View File
@@ -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;