Module: Mesa Branch: master Commit: 0c7272a66c633b0b11c0b81c0f3552201d083b3a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c7272a66c633b0b11c0b81c0f3552201d083b3a
Author: Eric Engestrom <[email protected]> Date: Sun Sep 3 19:22:06 2017 +0100 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]> --- src/intel/vulkan/anv_formats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index c23b143cac..eead1aa790 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; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
