mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
anv: fix off by one in array check
`anv_formats[ARRAY_SIZE(anv_formats)]` is already one too far.
Spotted by Coverity.
CovID: 1417259
Fixes: 242211933a "anv/formats: Nicely handle unknown VkFormat enums"
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
parent
979be4f9c8
commit
0c7272a66c
1 changed files with 1 additions and 1 deletions
|
|
@ -253,7 +253,7 @@ static const struct anv_format anv_formats[] = {
|
|||
static bool
|
||||
format_supported(VkFormat vk_format)
|
||||
{
|
||||
if (vk_format > ARRAY_SIZE(anv_formats))
|
||||
if (vk_format >= ARRAY_SIZE(anv_formats))
|
||||
return false;
|
||||
|
||||
return anv_formats[vk_format].isl_format != ISL_FORMAT_UNSUPPORTED;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue