From 3ef1db42c7cdd3a7ae55d973fd3a0a7d3879a459 Mon Sep 17 00:00:00 2001 From: Tanner Van De Walle Date: Fri, 8 May 2026 15:36:12 -0700 Subject: [PATCH] gallium/u_blitter: add lower-bound assert on target blitter_get_fs_texfetch_col asserts target < PIPE_MAX_TEXTURE_TYPES but not >= 0. MSVC's prefast static analyzer reports C33010 (UNCHECKED_LOWER_BOUND_FOR_ENUMINDEX) when target is later used as an array subscript, since it cannot prove the non-negative side of the bound. Extending the existing assert to both sides silences the warning and is a real bound check. Reviewed-by: Jesse Natalie Part-of: --- src/gallium/auxiliary/util/u_blitter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index be9e3ef4c7a..47c78d5d9ed 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -968,7 +968,7 @@ static void *blitter_get_fs_texfetch_col(struct blitter_context_priv *ctx, enum tgsi_return_type dtype; unsigned type; - assert(target < PIPE_MAX_TEXTURE_TYPES); + assert(target >= 0 && target < PIPE_MAX_TEXTURE_TYPES); if (util_format_is_pure_uint(src_format)) { stype = TGSI_RETURN_TYPE_UINT;