From: Alyssa Rosenzweig Date: Mon, 23 Dec 2019 20:49:18 +0000 (-0500) Subject: pan/midgard: Bounds check lcra_restrict_range X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e75d757244f7f0b727ff2eaaa06c94e805e8474;p=mesa.git pan/midgard: Bounds check lcra_restrict_range We may call it with sentinel values (~0 in particular) corresponding to unused arguments; ignore these. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/lcra.c b/src/panfrost/midgard/lcra.c index a280a744b92..28f9a735a44 100644 --- a/src/panfrost/midgard/lcra.c +++ b/src/panfrost/midgard/lcra.c @@ -101,7 +101,7 @@ lcra_set_disjoint_class(struct lcra_state *l, unsigned c1, unsigned c2) void lcra_restrict_range(struct lcra_state *l, unsigned node, unsigned len) { - if (l->alignment[node]) + if (node < l->node_count && l->alignment[node]) l->modulus[node] = DIV_ROUND_UP(l->bound - len + 1, 1 << (l->alignment[node] - 1)); }