commit 9b463ac36d418a1e4e23e95fca82aa4862203c38
parent fdae39e8b8e37d73305f37afd97a566d28a57ee0
Author: veltza <106755522+veltza@users.noreply.github.com>
Date: Tue, 2 Apr 2024 21:05:32 +0300
sixel: prevent crashing when size is zero (#129)
Crashing happens when you zoom out and the width or height of an image
becomes zero.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/x.c b/x.c
@@ -3145,8 +3145,8 @@ xfinishdraw(void)
continue;
/* scale the image */
- width = im->width * win.cw / im->cw;
- height = im->height * win.ch / im->ch;
+ width = MAX(im->width * win.cw / im->cw, 1);
+ height = MAX(im->height * win.ch / im->ch, 1);
if (!im->pixmap) {
im->pixmap = (void *)XCreatePixmap(xw.dpy, xw.win, width, height,
#if ALPHA_PATCH