[Piglit] [PATCH] astc: avoid deleting a random texture

Ilia Mirkin imirkin at alum.mit.edu
Sat Nov 21 16:08:12 PST 2015


In the check_error case, decompressed_tex is completely uninitialized
and might point to any texture. This can wreak various havoc.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
index 20f2415..d9c1c30 100644
--- a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
+++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
@@ -213,7 +213,8 @@ bool draw_compare_levels(bool check_error, bool check_srgb,
 
 	/* Delete bound textures */
 	glDeleteTextures(1, &compressed_tex);
-	glDeleteTextures(1, &decompressed_tex);
+	if (!check_error)
+		glDeleteTextures(1, &decompressed_tex);
 
 	piglit_present_results();
 	return pass;
-- 
2.4.10



More information about the Piglit mailing list