From ad3dd80720676dcdc11ab5db63ccbed7c9509d7e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 6 Jan 2014 06:52:32 +0800 Subject: [PATCH] glamor: Fix stack overflow in glamor_solid vertex handling. ARRAY_SIZE(vertices) is 32 (floating point values), so we need to divide by the number of floats in a box like we do in the overflow case below. Signed-off-by: Eric Anholt Reviewed-by: Markus Wick --- glamor/glamor_fill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c index dda55eace..75c952ca1 100644 --- a/glamor/glamor_fill.c +++ b/glamor/glamor_fill.c @@ -189,7 +189,7 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color) GLfloat xscale, yscale; float vertices[32]; float *pvertices = vertices; - int valid_nbox = ARRAY_SIZE(vertices); + int valid_nbox = ARRAY_SIZE(vertices) / (4 * 2); glamor_set_destination_pixmap_priv_nc(pixmap_priv);