mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-19 20:08:06 +02:00
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 <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41447>
This commit is contained in:
parent
427158f784
commit
3ef1db42c7
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue