I don't think that's the problem.

The data[] array has size 176; the upper four bits come from cy and the lower four from cx. (160 & 0xF0) is the same as (168 & 0xF0) so changing the bound from 160 to 168 won't make any difference.

The best way to find the bug, if you are able to reproduce it, is to run ZC in a debugger and get a stack trace at the moment the out-of-bounds access occurs. I don't think the bug could be in either of the lookahead functions: it's easy to check that the maximum possible value of "combo" is

(160 & 0xF0) + (240 >> 4) = 175 < 176

as required, and clearly combo >= 0.