mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 01:50:10 +01:00
freedreno/a6xx: Fix UB in convert_color()
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:
parent
3eef0c0245
commit
f0465ced7f
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue