freedreno/a6xx: Fix UB in convert_color()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Swizzle can include PIPE_SWIZZLE_0/_1 (4 and 5) which result in indexing
beyond the channel array.

Reported-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Fixes: 76e350671f ("freedreno/a6xx: Sysmem clear fixes")
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38593>
This commit is contained in:
Rob Clark 2025-11-22 09:02:23 -08:00 committed by Marge Bot
parent 3eef0c0245
commit f0465ced7f

View file

@ -867,6 +867,9 @@ convert_color(enum pipe_format format, union pipe_color_union *pcolor)
for (unsigned i = 0; i < 4; i++) {
unsigned channel = desc->swizzle[i];
if (channel >= 4) /* PIPE_SWIZZLE_0/_1 */
continue;
if (desc->channel[channel].normalized)
continue;