gallium: fix type size in z24_unorm_packed_pack_z_32unorm

util_format_z24_unorm_packed_pack_z_32unorm was accidentally writing
48-bits instead of 24 since it used a 16-bit integer pointer instead of
an 8-bit pointer. This could cause a segfault if the function was used,
but it is currently unused.

Fixes: 18f352090d ("util/format: Add a Z24_UNORM_PACKED format")

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41288>
This commit is contained in:
Jakob Sinclair 2026-05-13 14:29:19 +02:00 committed by Marge Bot
parent 0925c68adf
commit 3a3099369f

View file

@ -274,7 +274,7 @@ util_format_z24_unorm_packed_pack_z_32unorm(uint8_t *restrict dst_row, unsigned
unsigned x, y;
for(y = 0; y < height; ++y) {
const uint32_t *src = src_row;
uint16_t *dst = (uint16_t *)dst_row;
uint8_t *dst = dst_row;
for(x = 0; x < width; ++x) {
uint32_t tmp = z32_unorm_to_z24_unorm(*src++);