summaryrefslogtreecommitdiff
path: root/src/egl/main
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2014-02-07 14:44:05 +0200
committerBrian Paul <brianp@vmware.com>2014-02-07 08:14:05 -0700
commit498d10e230663f8604d00608cae6324f779c9cdd (patch)
tree47673d04e02f835ec357e2661f1eec12b105bd3a /src/egl/main
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 <juhapekka.heikkila@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/egl/main')
-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;