From 71a5bcb8658491dd62b9e620a9ce7f3bf7c8952b Mon Sep 17 00:00:00 2001 From: "Thomas H.P. Andersen" Date: Wed, 14 Jul 2021 14:51:26 +0200 Subject: [PATCH] nine: Fix assert in tx_src_param A previous commit cleaned up the asserts but the last part of this assert looks like it got mixed up. It should have allowed param->rel for D3DSPR_INPUT if version is 3.0. Instead it does && on the enum value D3DSPR_ADDR which is of course always true, with the version check. The result is that we miss input validation with version 3.0. Spotted by a compile warning Fixes: 5974401a4ad ("st/nine: Regroup param->rel tests") Reviewed-by: Axel Davy davyaxel0@gmail.com Part-of: --- src/gallium/frontends/nine/nine_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/nine/nine_shader.c b/src/gallium/frontends/nine/nine_shader.c index 6e1d470..613fe1f 100644 --- a/src/gallium/frontends/nine/nine_shader.c +++ b/src/gallium/frontends/nine/nine_shader.c @@ -1010,7 +1010,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) struct ureg_dst tmp; assert(!param->rel || (IS_VS && param->file == D3DSPR_CONST) || - (D3DSPR_ADDR && tx->version.major == 3)); + (param->file == D3DSPR_INPUT && tx->version.major == 3)); switch (param->file) { -- 2.7.4