mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-14 04:27:57 -05:00
sixel: remove sixel-to-be-splitted *before* splitting it
This fixes an assertion in debug builds, due to the pre-splitted and splitted sixels overlapping.
This commit is contained in:
parent
fda6e9c2c9
commit
f6473756d9
2 changed files with 10 additions and 4 deletions
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
* Crash when overwriting a sixel and the row being overwritten did not
|
||||
cover an entire cell.
|
||||
* Assertion failure in debug builds when overwriting a sixel image.
|
||||
|
||||
|
||||
### Security
|
||||
|
||||
|
|
|
|||
12
sixel.c
12
sixel.c
|
|
@ -350,9 +350,11 @@ _sixel_overwrite_by_rectangle(
|
|||
(col <= col_end && col + width - 1 >= col_end) ||
|
||||
(col >= col_start && col + width - 1 <= col_end))
|
||||
{
|
||||
sixel_overwrite(term, six, start, col, height, width);
|
||||
sixel_erase(term, six);
|
||||
struct sixel to_be_erased = *six;
|
||||
tll_remove(term->grid->sixel_images, it);
|
||||
|
||||
sixel_overwrite(term, &to_be_erased, start, col, height, width);
|
||||
sixel_erase(term, &to_be_erased);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -421,9 +423,11 @@ sixel_overwrite_by_row(struct terminal *term, int _row, int col, int width)
|
|||
(col <= col_end && col + width - 1 >= col_end) ||
|
||||
(col >= col_start && col + width - 1 <= col_end))
|
||||
{
|
||||
sixel_overwrite(term, six, row, col, 1, width);
|
||||
sixel_erase(term, six);
|
||||
struct sixel to_be_erased = *six;
|
||||
tll_remove(term->grid->sixel_images, it);
|
||||
|
||||
sixel_overwrite(term, &to_be_erased, row, col, 1, width);
|
||||
sixel_erase(term, &to_be_erased);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue