summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-09-03 19:22:06 +0100
committerEric Engestrom <[email protected]>2017-09-04 08:05:36 +0100
commit0c7272a66c633b0b11c0b81c0f3552201d083b3a (patch)
tree3254b06f20e75b293af8a1972aff1d8b23eec9d2 /src/intel/vulkan
parent979be4f9c80a51c7294726bb75a00d5acbb0acc8 (diff)
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: 242211933a0682696170 "anv/formats: Nicely handle unknown VkFormat enums" Cc: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_formats.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index c23b143cac2..eead1aa7909 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -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;