summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-05-18 09:04:57 +0800
committerPo Lu <luangruo@yahoo.com>2023-05-18 09:04:57 +0800
commit074c0268fd32d6527e124cff386bb6b15cf90017 (patch)
tree62111c3c70d46a738f15514e988a707409ca45f4 /src/dispnew.c
parentdb48eff8cf4a88393c0209f663ca194ee37fa747 (diff)
parent5ef169ed701fa4f850fdca5563cdd468207d5d4f (diff)
downloademacs-feature/android.tar.gz
Merge remote-tracking branch 'origin/master' into feature/androidfeature/android
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 54948af975b..8d039bf9a3d 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1391,7 +1391,7 @@ realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim)
|| matrix_dim.width != pool->ncolumns);
/* Enlarge the glyph pool. */
- if (INT_MULTIPLY_WRAPV (matrix_dim.height, matrix_dim.width, &needed))
+ if (ckd_mul (&needed, matrix_dim.height, matrix_dim.width))
memory_full (SIZE_MAX);
if (needed > pool->nglyphs)
{
@@ -6688,8 +6688,8 @@ init_display_interactive (void)
change. It's not clear what better we could do. The rest of
the code assumes that (width + 2) * height * sizeof (struct glyph)
does not overflow and does not exceed PTRDIFF_MAX or SIZE_MAX. */
- if (INT_ADD_WRAPV (width, 2, &area)
- || INT_MULTIPLY_WRAPV (height, area, &area)
+ if (ckd_add (&area, width, 2)
+ || ckd_mul (&area, area, height)
|| min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph) < area)
fatal ("screen size %dx%d too big", width, height);
}