[Piglit] [PATCH] texwrap: Add default cases with asserts.

Vinson Lee vlee at freedesktop.org
Sat Dec 8 20:59:51 PST 2012


Fixes uninitialized pointer read defect reported by Coverity.

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

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index 6d7dbb6..7612c72 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -1355,6 +1355,9 @@ static void init_int_texture(const struct format_desc *format,
 		case 32:
 			colors = i32colors;
 			break;
+		default:
+			assert(0);
+			break;
 		}
 		break;
 	case UINT_TYPE:
@@ -1371,6 +1374,9 @@ static void init_int_texture(const struct format_desc *format,
 		case 32:
 			colors = (int**)ui32colors;
 			break;
+		default:
+			assert(0);
+			break;
 		}
 		break;
 	default:
-- 
1.8.0.1



More information about the Piglit mailing list