When hitting bad data it will go into infinite loop and the logic there is incorrect for finding header (it should finding every data not the data in data.length/4), also it should return the value of i+offset and start find it from offset+1.
Thanks to @Noisyfox and others for helping me in this issue!
When hitting bad data it will go into infinite loop and the logic there is incorrect for finding header (it should finding every data not the data in data.length/4), also it should return the value of i+offset and start find it from offset+1. Thanks to @Noisyfox and others for helping me in this issue!