summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorTomasz Borowik <timon37@gmail.com>2014-07-03 13:04:44 -0700
committerKeith Packard <keithp@keithp.com>2014-07-03 13:05:19 -0700
commita61ca6f006d70343c88fe45206fae0669d1e8971 (patch)
tree2609de378833954389bf08b4967420ad4da856f9 /glamor
parent10d2805dbc6b96a159b8c5acedcd53f34df362bf (diff)
glamor: Fix stack corruption in glamor_init
glGet on GL_MAX_VIEWPORT_DIMS returns two values Reviewed-by: Markus Wick <markus@selfnet.de> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index c398807f1..358890375 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -316,7 +316,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
{
glamor_screen_private *glamor_priv;
int gl_version;
- int max_viewport_size;
+ int max_viewport_size[2];
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
@@ -408,8 +408,9 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->has_buffer_storage =
epoxy_has_gl_extension("GL_ARB_buffer_storage");
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glamor_priv->max_fbo_size);
- glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &max_viewport_size);
- glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size);
+ glGetIntegerv(GL_MAX_VIEWPORT_DIMS, max_viewport_size);
+ glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size[0]);
+ glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size[1]);
#ifdef MAX_FBO_SIZE
glamor_priv->max_fbo_size = MAX_FBO_SIZE;
#endif