[PATCH] glamor: Fix GLES2 non-VBO temporary memory allocation.

Eric Anholt eric at anholt.net
Mon Jun 16 00:06:53 PDT 2014


We'd get a request for like 16 bytes, claim to have allocated
GLAMOR_VBO_SIZE, and then not reallocate when something a request
bigger than 16 came along.  The intent was to always allocate at least
GLAMOR_VBO_SIZE.

Fixes segfaults with Xephyr -glamor_gles2 and running gnome-terminal.

Signed-off-by: Eric Anholt <eric at anholt.net>
---

Of the pile of patches I've sent today, this is the only one intended
for -fixes.

 glamor/glamor_vbo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/glamor/glamor_vbo.c b/glamor/glamor_vbo.c
index c678559..e906101 100644
--- a/glamor/glamor_vbo.c
+++ b/glamor/glamor_vbo.c
@@ -119,7 +119,7 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset)
         if (glamor_priv->vbo_size < size) {
             glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size);
             free(glamor_priv->vb);
-            glamor_priv->vb = XNFalloc(size);
+            glamor_priv->vb = XNFalloc(glamor_priv->vbo_size);
         }
         *vbo_offset = NULL;
         /* We point to the start of glamor_priv->vb every time, and
-- 
2.0.0



More information about the xorg-devel mailing list