diff options
author | Gwan-gyeong Mun <[email protected]> | 2016-11-20 20:44:22 +0900 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-11-22 15:15:45 +0000 |
commit | e074a08a6ded3260f13111d0e23961dea2da2442 (patch) | |
tree | 943420dc615d9fab9d334badcdb11b700dc799dd /src/intel/vulkan | |
parent | 69cc7d90f9f60d95cd570a4e87755a474554d41f (diff) |
anv: Fix unintentional integer overflow in anv_CreateDmaBufImageINTEL
Since both pCreateInfo->strideInBytes and pCreateInfo->extent.height
are of uint32_t type 32-bit arithmetic will be used.
Fix unintentional integer overflow by casting to uint64_t before
multifying.
CID 1394321
Cc: "13.0" <[email protected]>
Signed-off-by: Mun Gwan-gyeong <[email protected]>
[Emil Velikov: cast only of the arguments]
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_intel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_intel.c b/src/intel/vulkan/anv_intel.c index 1c50e2bdd38..c356e848fe0 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 * pCreateInfo->extent.height; anv_bo_init(&mem->bo, gem_handle, size); |