summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2014-02-07 14:44:04 +0200
committerBrian Paul <brianp@vmware.com>2014-02-07 08:14:05 -0700
commit1456ed85f0ed8b9c9f0abd6bd389a089fa3824b2 (patch)
tree7c3538e69078fc760508bd1e6a7dfbfc6ae3ed9c /src
parentd530745169282469b2dd8221629ef948ff31bcf3 (diff)
downloadexternal_mesa3d-1456ed85f0ed8b9c9f0abd6bd389a089fa3824b2.zip
external_mesa3d-1456ed85f0ed8b9c9f0abd6bd389a089fa3824b2.tar.gz
external_mesa3d-1456ed85f0ed8b9c9f0abd6bd389a089fa3824b2.tar.bz2
egl: Unhide functionality in _eglInitContext()
_eglInitResource() was used to memset entire _EGLContext by writing more than size of pointed target. This does work as long as Resource is the first element in _EGLContext, 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')
-rw-r--r--src/egl/main/eglcontext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 79a92c7..99d1c3e 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -366,7 +366,8 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
return EGL_FALSE;
}
- _eglInitResource(&ctx->Resource, sizeof(*ctx), dpy);
+ memset(ctx, 0, sizeof(_EGLContext));
+ _eglInitResource(&ctx->Resource, sizeof(_EGLResource), dpy);
ctx->ClientAPI = api;
ctx->Config = conf;
ctx->WindowRenderBuffer = EGL_NONE;