From e1938c189223164f3a75cf848e90ecc1d2e55d15 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 22 Aug 2018 22:30:34 +0200 Subject: libNX_X11: upgrade to X.org upstream version 1.6.6 We are at X.Org libX11 upstream commit 733f64b Fixes: ArcticaProject/nx-libs #716, #719 and #720 --- nx-X11/lib/src/GetImage.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'nx-X11/lib/src/GetImage.c') diff --git a/nx-X11/lib/src/GetImage.c b/nx-X11/lib/src/GetImage.c index d80f6715f..96d9ce337 100644 --- a/nx-X11/lib/src/GetImage.c +++ b/nx-X11/lib/src/GetImage.c @@ -105,14 +105,16 @@ XImage *XGetImage ( planes = 1; } - if (!image) + if (!image) { Xfree(data); - if (planes < 1 || image->height < 1 || image->bytes_per_line < 1 || - INT_MAX / image->height <= image->bytes_per_line || - INT_MAX / planes <= image->height * image->bytes_per_line || - nbytes < planes * image->height * image->bytes_per_line) { - XDestroyImage(image); - image = NULL; + } else { + if (planes < 1 || image->height < 1 || image->bytes_per_line < 1 || + INT_MAX / image->height <= image->bytes_per_line || + INT_MAX / planes <= image->height * image->bytes_per_line || + nbytes < planes * image->height * image->bytes_per_line) { + XDestroyImage(image); + image = NULL; + } } UnlockDisplay(dpy); SyncHandle(); -- cgit v1.2.3