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:
parent
fdae39e8b8
commit
9b463ac36d
4
x.c
4
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
|
||||
|
|
Loading…
Reference in New Issue