summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2010-01-17 01:13:45 -0800
committerCorbin Simpson <[email protected]>2010-01-17 01:13:45 -0800
commit945cea01d9620ddd6a459e30517080e2bceb6bc5 (patch)
treebe66e171a248ab99e88b589907afb025cb43e17e /src/gallium
parentb62d339301f32d29c0a0fdaba2a0e192bff42c23 (diff)
r300g: Check for bogus texture targets.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r300/r300_screen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index e9727e99df4..67325c6b80a 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -192,6 +192,12 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
uint32_t retval = 0;
boolean is_r500 = r300_screen(screen)->caps->is_r500;
+ if (target >= PIPE_MAX_TEXTURE_TYPES) {
+ debug_printf("r300: Implementation error: Received bogus texture "
+ "target %d in %s\n", target, __FUNCTION__);
+ return FALSE;
+ }
+
switch (format) {
/* Supported formats. */
/* Colorbuffer */