Browse Source

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 <alyssa.rosenzweig@collabora.com>
master
Alyssa Rosenzweig 6 years ago
parent
commit
4e75d75724
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/panfrost/midgard/lcra.c

+ 1
- 1
src/panfrost/midgard/lcra.c View File

@@ -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));
}


Loading…
Cancel
Save