From: Corbin Simpson Date: Sun, 17 Jan 2010 09:13:45 +0000 (-0800) Subject: r300g: Check for bogus texture targets. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=945cea01d9620ddd6a459e30517080e2bceb6bc5;p=mesa.git r300g: Check for bogus texture targets. --- 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 */