This histogram index was not correctly downshifted to 8-bit.
Unified · Split
| @@ -189,7 +189,7 @@ static void get_hist16(int *hist, const uint8_t *p, ptrdiff_t stride, · 188 unmodified lines | ||
| 189 | 189 | } |
| 190 | 190 | /* handle tail */ |
| 191 | 191 | for (int x = width4; x < width; x++) |
| 192 | − hist[p16[x]]++; | |
| 192 | + hist[(uint8_t) (p16[x] >> shift)]++; | |
| 193 | 193 | p += stride; |
| 194 | 194 | } |
| 195 | 195 | |