Module: Mesa
Branch: master
Commit: eddbbd8b6850623becd2fcbc3dd88857e58651ca
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=eddbbd8b6850623becd2fcbc3dd88857e58651ca

Author: Juan A. Suarez Romero <[email protected]>
Date:   Tue Apr  6 16:45:20 2021 +0200

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 <[email protected]>
Signed-off-by: Juan A. Suarez Romero <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10060>

---

 src/broadcom/cle/v3d_packet_helpers.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/broadcom/cle/v3d_packet_helpers.h 
b/src/broadcom/cle/v3d_packet_helpers.h
index 53a5215fb9a..2b5e32ff215 100644
--- a/src/broadcom/cle/v3d_packet_helpers.h
+++ b/src/broadcom/cle/v3d_packet_helpers.h
@@ -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);
    }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to