[Piglit] [PATCH] arb_sparse_buffer: Fix Coverity unintentional integer overflow defect.

Vinson Lee vlee at freedesktop.org
Thu May 18 22:32:58 UTC 2017


CID: 1405992
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_sparse_buffer/buffer-data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_sparse_buffer/buffer-data.c b/tests/spec/arb_sparse_buffer/buffer-data.c
index 31ece6fcd38a..b4cc6e5c6bb1 100644
--- a/tests/spec/arb_sparse_buffer/buffer-data.c
+++ b/tests/spec/arb_sparse_buffer/buffer-data.c
@@ -481,7 +481,7 @@ run_stress(unsigned num_iterations)
 	unsigned log_num_pages = 10;
 	bool pass = true;
 
-	buf = create_buffers((1 << log_num_pages) * sparse_buffer_page_size);
+	buf = create_buffers((1ull << log_num_pages) * sparse_buffer_page_size);
 
 	/* Initialize a fairly dense random commitment. */
 	for (unsigned page = 0; page < (1 << log_num_pages);) {
-- 
2.9.3



More information about the Piglit mailing list