[var] Fix assertion

Fixes https://oss-fuzz.com/testcase-detail/4861707188305920
This commit is contained in:
Behdad Esfahbod 2023-04-27 12:38:44 -06:00
parent 7cb95c8ab7
commit 9b5afad493

View file

@ -270,7 +270,8 @@ struct TupleVariationHeader
if (shared_tuple_active_idx)
{
assert (index < shared_tuple_active_idx->length);
if (unlikely (index >= shared_tuple_active_idx->length))
return 0.f;
int v = (*shared_tuple_active_idx).arrayZ[index];
if (v != -1)
{