From e7672080699d0d3593167efec40b17cca69e644a Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Mon, 15 Mar 2021 20:32:52 +0200 Subject: [PATCH] ir3: fix oob access to regs array for getbuf,getinfo,rgetinfo Since they have zero source registers, src->regs[1] is out of bounds. It probably wasn't able to cause any harm, but it's always better be safe. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4209 Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/isa/ir3-cat5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/isa/ir3-cat5.xml b/src/freedreno/isa/ir3-cat5.xml index 2568f40c253..92697f6584c 100644 --- a/src/freedreno/isa/ir3-cat5.xml +++ b/src/freedreno/isa/ir3-cat5.xml @@ -157,7 +157,7 @@ SOFTWARE. --> extract_cat5_SRC(src, 1) extract_cat5_SRC(src, 2) - src->regs[1] + (src->regs_count > 1) ? src->regs[1] : NULL