Fix SIXEL median-cut palette generation

This commit is contained in:
Michael Grant
2026-08-05 21:45:45 +01:00
parent 507ecd320a
commit 718e281820

View File

@@ -859,6 +859,9 @@ sixel_box_split(struct sixel_box *box, struct sixel_box *new,
if (count >= box->count / 2)
break;
}
/* Keep the maximum occupied level in the new box. */
if (level == last)
level--;
memcpy(new, box, sizeof *new);
if (channel == 0) {
box->red_max = level;