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:
Eric Engestrom 2017-09-03 19:22:06 +01:00
parent 979be4f9c8
commit 0c7272a66c

View file

@ -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;