From 945cea01d9620ddd6a459e30517080e2bceb6bc5 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 17 Jan 2010 01:13:45 -0800 Subject: [PATCH] r300g: Check for bogus texture targets. --- src/gallium/drivers/r300/r300_screen.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 */ -- 2.30.2