From 3a3099369fbfa8bb5aea0d34a5967aae5535dc48 Mon Sep 17 00:00:00 2001 From: Jakob Sinclair Date: Wed, 13 May 2026 14:29:19 +0200 Subject: [PATCH] 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: 18f352090d4 ("util/format: Add a Z24_UNORM_PACKED format") Reviewed-by: Boris Brezillon Reviewed-by: Erik Faye-Lund Part-of: --- src/util/format/u_format_zs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/format/u_format_zs.c b/src/util/format/u_format_zs.c index 4326daef526..e6ef0843774 100644 --- a/src/util/format/u_format_zs.c +++ b/src/util/format/u_format_zs.c @@ -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++);