sixel: prevent crashing when size is zero (#129)

Crashing happens when you zoom out and the width or height of an image
becomes zero.
This commit is contained in:
veltza 2024-04-02 21:05:32 +03:00 committed by GitHub
parent fdae39e8b8
commit 9b463ac36d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

4
x.c
View File

@ -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