From 82c6f2ea32ade11aa3816930a582f1c28118d6d1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Apr 2021 13:10:41 -0700 Subject: [PATCH] u_format: Fix z32_s8x24 s8 unpacking on big-endian. The s8x24 is a packed group in the format, and for packing we properly write our s8 in the low bits of the 32, but for unpacking we tried treating it as a byte array. Reviewed-by: Adam Jackson Part-of: --- src/util/format/u_format_zs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/format/u_format_zs.c b/src/util/format/u_format_zs.c index 2ebf0ca3af5..05f023c6c26 100644 --- a/src/util/format/u_format_zs.c +++ b/src/util/format/u_format_zs.c @@ -873,10 +873,10 @@ util_format_z32_float_s8x24_uint_unpack_s_8uint(uint8_t *restrict dst_row, unsig unsigned x, y; for(y = 0; y < height; ++y) { uint8_t *dst = dst_row; - const uint8_t *src = src_row + 4; + const uint32_t *src = (uint32_t *)(src_row + 4); for(x = 0; x < width; ++x) { *dst = *src; - src += 8; + src += 2; dst += 1; } src_row += src_stride/sizeof(*src_row);