TurboPFor-Integer-Compression icon indicating copy to clipboard operation
TurboPFor-Integer-Compression copied to clipboard

a bug in icapp.c:1014

Open BeeBreeze opened this issue 4 years ago • 0 comments

#define MINDELTA(t, in, n, dmin) {
t *_p = (t *)in, _i;
for(dmin = (t)-1, _i = 1; _i < n; _i++)
if(_p[_i] < _p[_i-1]) { dmin = (t)-1; break; }
else { t _d = _p[_i] - _p[_i-1]; if(_d < dmin) { dmin = _d; /printf("[%u]", dmin);/} }
} Note that, the type of n is unsigned, while t may be uint8_t. That is to say, 0\leq _i \leq 255, which leads to that the loop will never end. I think the type of _i should be the same as that of n.

BeeBreeze avatar Nov 16 '21 07:11 BeeBreeze