summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2014-02-07 14:44:05 +0200
committerBrian Paul <[email protected]>2014-02-07 08:14:05 -0700
commit498d10e230663f8604d00608cae6324f779c9cdd (patch)
tree47673d04e02f835ec357e2661f1eec12b105bd3a
parent1456ed85f0ed8b9c9f0abd6bd389a089fa3824b2 (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/egl/main/eglsurface.c4
1 files changed, 3 insertions, 1 deletions
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;