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 <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
This commit is contained in:
Eric Anholt 2014-01-06 06:52:32 +08:00
parent d036d22a95
commit ad3dd80720

View File

@ -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);