aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--sixel.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a69f58b8..ce1a7d8c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -124,9 +124,12 @@
* Regression: visual glitches in rare circumstances.
* Key release events for shortcuts being sent to the client
application (kitty keyboard protocol only) ([#2257][2257]).
+* Crash when application emits sixel RA with a height of 0, a width >
+ 0, and then starts writing sixel data ([#2267][2267]).
[2232]: https://codeberg.org/dnkl/foot/issues/2232
[2257]: https://codeberg.org/dnkl/foot/issues/2257
+[2267]: https://codeberg.org/dnkl/foot/issues/2267
### Security
diff --git a/sixel.c b/sixel.c
index 294864fd..187f1348 100644
--- a/sixel.c
+++ b/sixel.c
@@ -1559,6 +1559,9 @@ resize(struct terminal *term, int new_width_mutable, int new_height_mutable)
new_height_mutable = term->sixel.max_height;
}
+ if (unlikely(new_height_mutable == 0)) {
+ new_height_mutable = 6 * term->sixel.pan;
+ }
uint32_t *old_data = term->sixel.image.data;
const int old_width = term->sixel.image.width;