[Piglit] [PATCH] texelFetch: Ensure level_image is initialized.

Vinson Lee vlee at freedesktop.org
Sat Dec 8 21:25:22 PST 2012


Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/texturing/shaders/texelFetch.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/texturing/shaders/texelFetch.c b/tests/texturing/shaders/texelFetch.c
index 4ee607e..aced7bc 100644
--- a/tests/texturing/shaders/texelFetch.c
+++ b/tests/texturing/shaders/texelFetch.c
@@ -352,6 +352,10 @@ generate_texture()
 		case GL_INT:
 			level_image = i_level;
 			break;
+		default:
+			assert(!"Unexpected data type");
+			level_image = NULL;
+			break;
 		}
 
 		upload_miplevel_data(target, l, level_image);
-- 
1.8.0.1



More information about the Piglit mailing list