From 8251bd216e7ff300b93788cd1e2d49c301f5fe49 Mon Sep 17 00:00:00 2001 From: Sergii Melikhov Date: Thu, 27 May 2021 14:46:04 +0300 Subject: [PATCH] util/format: Change the pointer offset. Changed the pointer offset to 2 to account for the second structure variable. Fixes: 90f98b56f85 ("mesa: Deduplicate _mesa_pack_uint_z_row().") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4685 Signed-off-by: Sergii Melikhov Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Emma Anholt Part-of: --- src/util/format/u_format_zs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/format/u_format_zs.c b/src/util/format/u_format_zs.c index 05f023c6c26..0bd5025d2a5 100644 --- a/src/util/format/u_format_zs.c +++ b/src/util/format/u_format_zs.c @@ -858,7 +858,8 @@ util_format_z32_float_s8x24_uint_pack_z_32unorm(uint8_t *restrict dst_row, unsig const uint32_t *src = src_row; float *dst = (float *)dst_row; for(x = 0; x < width; ++x) { - *dst++ = z32_unorm_to_z32_float(*src++); + *dst = z32_unorm_to_z32_float(*src++); + dst += 2; } dst_row += dst_stride/sizeof(*dst_row); src_row += src_stride/sizeof(*src_row);