mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Avoid overshooting Sixel height in sixel_parse_write, GitHub issue 5071 from
nincsnevem662 at gmail dot com.
This commit is contained in:
@@ -122,19 +122,13 @@ sixel_set_pixel(struct sixel_image *si, u_int x, u_int y, u_int c)
|
|||||||
static int
|
static int
|
||||||
sixel_parse_write(struct sixel_image *si, u_int ch)
|
sixel_parse_write(struct sixel_image *si, u_int ch)
|
||||||
{
|
{
|
||||||
struct sixel_line *sl;
|
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
if (sixel_parse_expand_lines(si, si->dy + 6) != 0)
|
|
||||||
return (1);
|
|
||||||
sl = &si->lines[si->dy];
|
|
||||||
|
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
if (sixel_parse_expand_line(si, sl, si->dx + 1) != 0)
|
if (ch & (1 << i)) {
|
||||||
return (1);
|
if (sixel_set_pixel(si, si->dx, si->dy + i, si->dc))
|
||||||
if (ch & (1 << i))
|
return (1);
|
||||||
sl->data[si->dx] = si->dc;
|
}
|
||||||
sl++;
|
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user