mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-06-13 14:33:17 -04:00
sixel: fix NULL deref when using a shared palette and gamma-correct blending
This fixes a copy-paste error where we read/modified/wrote the private-palette instead of the shared palette. Since the private palette is NULL in this case, that meant a crash. Closes #2370
This commit is contained in:
parent
c9c448e611
commit
75e201608b
2 changed files with 7 additions and 4 deletions
8
sixel.c
8
sixel.c
|
|
@ -169,10 +169,10 @@ sixel_init(struct terminal *term, int p1, int p2, int p3)
|
|||
|
||||
if (term->sixel.linear_blending || term->sixel.use_10bit) {
|
||||
for (size_t i = 0; i < active_palette_entries; i++) {
|
||||
uint8_t r = (term->sixel.private_palette[i] >> 16) & 0xff;
|
||||
uint8_t g = (term->sixel.private_palette[i] >> 8) & 0xff;
|
||||
uint8_t b = (term->sixel.private_palette[i] >> 0) & 0xff;
|
||||
term->sixel.private_palette[i] = color_decode_srgb(term, r, g, b);
|
||||
uint8_t r = (term->sixel.shared_palette[i] >> 16) & 0xff;
|
||||
uint8_t g = (term->sixel.shared_palette[i] >> 8) & 0xff;
|
||||
uint8_t b = (term->sixel.shared_palette[i] >> 0) & 0xff;
|
||||
term->sixel.shared_palette[i] = color_decode_srgb(term, r, g, b);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue