ref: 1ccf6c1fc377432ff35ca75dbd018dd13f06a6f6
parent: 7b101d4fb3d0942d4b180b8e5a7b1e35af06d0bc
author: Ronald S. Bultje <[email protected]>
date: Wed Oct 24 07:15:51 EDT 2018
Use max value for all trailing palette entries Otherwise, if the non-last has a max value, the ones after it can go beyond the allowed range. Fixes #95.
--- a/src/decode.c
+++ b/src/decode.c
@@ -426,7 +426,7 @@
prev = pal[i++] = imin(prev + delta + !pl, max);
if (prev + !pl >= max) {
for (; i < pal_sz; i++)
- pal[i] = pal[i - 1] + !pl;
+ pal[i] = max;
break;
}
bits = imin(bits, 1 + ulog2(max - prev - !pl));