mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
v3d: use uint type in _gen_unpack_uint
Use a unsigned int type in the loop to avoid unintended sign extensions. Fixes CID#1414500 (Unintended sign extension [SIGN_EXTENSION]). Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10060>
This commit is contained in:
parent
d760a995e3
commit
eddbbd8b68
1 changed files with 1 additions and 1 deletions
|
|
@ -165,7 +165,7 @@ __gen_unpack_uint(const uint8_t *restrict cl, uint32_t start, uint32_t end)
|
|||
const int width = end - start + 1;
|
||||
const uint32_t mask = (width == 32 ? ~0 : (1 << width) - 1 );
|
||||
|
||||
for (int byte = start / 8; byte <= end / 8; byte++) {
|
||||
for (uint32_t byte = start / 8; byte <= end / 8; byte++) {
|
||||
val |= cl[byte] << ((byte - start / 8) * 8);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue