mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +02:00
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" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
[Emil Velikov: cast only of the arguments]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit e074a08a6d)
This commit is contained in:
parent
c19a331139
commit
a39e535d6c
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue