[Piglit] [PATCH] draw-pixels: Ensure allocPixels returns an initialized value.

Vinson Lee vlee at freedesktop.org
Thu Dec 6 23:02:12 PST 2012


Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/general/draw-pixels.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/general/draw-pixels.c b/tests/general/draw-pixels.c
index 36e0cd6..5871876 100644
--- a/tests/general/draw-pixels.c
+++ b/tests/general/draw-pixels.c
@@ -278,6 +278,11 @@ allocPixels(GLenum format, GLenum type, GLuint components)
 			}
 		}
 		break;
+
+	default:
+		assert(0);
+		pixels = NULL;
+		break;
 	}
 	return pixels;
 }
-- 
1.8.0.1



More information about the Piglit mailing list