pCreateInfo->strideInBytes * pCreateInfo->extent.height with type
"unsigned int" is evaluated using 32-bit arithmetic.
This fixes unintentional integer overflow by casting to uint64_t before
multifying.
CID 1394321
Signed-off-by: Mun Gwan-gyeong
---
src/intel/vulkan/anv_intel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_intel.c b/src/intel/vulkan/anv_intel.c
index 1c50e2b..8b251f8 100644
--- a/src/intel/vulkan/anv_intel.c
+++ b/src/intel/vulkan/anv_intel.c
@@ -55,7 +55,7 @@ VkResult anv_CreateDmaBufImageINTEL(
goto fail;
}
- uint64_t size = pCreateInfo->strideInBytes * pCreateInfo->extent.height;
+ uint64_t size = (uint64_t)pCreateInfo->strideInBytes *
(uint64_t)pCreateInfo->extent.height;
anv_bo_init(>bo, gem_handle, size);
--
2.10.2
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev