[Piglit] [PATCH] hiz: Explicitly use sizeof(float) in malloc.

Vinson Lee vlee at freedesktop.org
Sat Jan 18 20:38:46 PST 2014


Silences "Allocation size mismatch" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/general/hiz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/general/hiz.c b/tests/general/hiz.c
index a642256..10fa53c 100644
--- a/tests/general/hiz.c
+++ b/tests/general/hiz.c
@@ -162,7 +162,7 @@ GLboolean test_less()
 	glVertex3fv(v23);
 	glEnd();
 
-	pix = malloc(piglit_width * piglit_height * 12);
+	pix = malloc(piglit_width * piglit_height * 3 * sizeof(float));
 	glReadPixels(0, 0, piglit_width, piglit_height, GL_RGB, GL_FLOAT, pix);
 
 	/* check pixels */
-- 
1.8.3.2



More information about the Piglit mailing list