From b5a6375f546c8a74fb81a70db6819f0281e3292e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 31 Aug 2022 16:54:02 -0400 Subject: [PATCH] pan/bi: Fix out-of-bounds write in va_lower_split_64bit ...with dual source blending. Fixes shaders/dolphin/smg.1.shader_test There are more IR sources than Valhall machine sources here. Fixes: b48933d6411 ("pan/va: Include BLEND for va_swap_12") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/valhall/va_lower_split_64bit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/valhall/va_lower_split_64bit.c b/src/panfrost/bifrost/valhall/va_lower_split_64bit.c index e193ab32109..849b9111638 100644 --- a/src/panfrost/bifrost/valhall/va_lower_split_64bit.c +++ b/src/panfrost/bifrost/valhall/va_lower_split_64bit.c @@ -67,7 +67,7 @@ va_lower_split_64bit(bi_context *ctx) { bi_foreach_instr_global(ctx, I) { bi_foreach_src(I, s) { - if (bi_is_null(I->src[s])) + if (bi_is_null(I->src[s]) || s >= 4) continue; struct va_src_info info = va_src_info(I->op, s);