1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

Fix a crash on some versions of GTK

* src/emacsgtkfixed.c (XSetWMNormalHints): Fix potential
arithmetic fault.
This commit is contained in:
Po Lu 2022-02-18 18:01:58 +08:00
parent 3306e11107
commit 1f755a74b7

View File

@ -183,9 +183,12 @@ XSetWMSizeHints (Display *d,
if (hints->flags & PResizeInc)
{
if (data[5] % hints->width_inc)
/* Some versions of GTK set PResizeInc even if the
increments are at their initial values. */
if (hints->width_inc && data[5] % hints->width_inc)
data[5] += (hints->width_inc - (data[5] % hints->width_inc));
if (data[6] % hints->height_inc)
if (hints->height_inc && data[6] % hints->height_inc)
data[6] += (hints->height_inc - (data[6] % hints->height_inc));
}
}