From 425cf894d4db5401e069d5f1c76652eb822c131c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 21 Jun 2023 11:39:54 +0200 Subject: [PATCH] sixel: resize(): handle no size change --- sixel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sixel.c b/sixel.c index 29585d71..4a8a4e9c 100644 --- a/sixel.c +++ b/sixel.c @@ -1244,6 +1244,9 @@ resize(struct terminal *term, int new_width, int new_height) const int old_width = term->sixel.image.width; const int old_height = term->sixel.image.height; + if (unlikely(old_width == new_width && old_height == new_height)) + return true; + const int sixel_row_height = 6 * term->sixel.pan; int alloc_new_width = new_width; int alloc_new_height = (new_height + sixel_row_height - 1) / sixel_row_height * sixel_row_height;