Partially revert "tinf_decode_symbol: Don't traverse past end of TINF_TREE->table and ->trans."

.. I do not have any testcases demonstrating that the range check of
the access to t->trans is necessary.

This partially reverts commit cc278f73b6.
This commit is contained in:
Jeff Epler 2018-06-19 14:57:15 -05:00 committed by Jeff Epler
parent 4c50ea3f9e
commit d901303671

View file

@ -272,12 +272,7 @@ static int tinf_decode_symbol(TINF_DATA *d, TINF_TREE *t)
} while (cur >= 0);
sum += cur;
if (sum < 0 || sum >= TINF_ARRAY_SIZE(t->trans)) {
return TINF_DATA_ERROR;
}
return t->trans[sum];
return t->trans[sum + cur];
}
/* given a data stream, decode dynamic trees from it */