changeset 16891:989845750a4d

(init_display): Check for overflow in screen size.
author Richard M. Stallman <rms@gnu.org>
date Mon, 20 Jan 1997 01:21:07 +0000
parents 303cda7d14cb
children a8a539285d69
files src/dispnew.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Mon Jan 20 01:10:38 1997 +0000
+++ b/src/dispnew.c	Mon Jan 20 01:21:07 1997 +0000
@@ -2549,6 +2549,22 @@
 
   term_init (terminal_type);
 
+  {
+    int width = FRAME_WINDOW_WIDTH (selected_frame);
+    int height = FRAME_HEIGHT (selected_frame);
+
+    unsigned int total_glyphs = height * (width + 2) * sizeof (GLYPH);
+
+    /* If these sizes are so big they cause overflow,
+       just ignore the change.  It's not clear what better we could do.  */
+    if (total_glyphs / sizeof (GLYPH) / height != width + 2)
+      {
+	fprintf (stderr, "emacs: screen size %dx%d too big\n,",
+		 width, height);
+	exit (1);
+      }
+  }
+
   remake_frame_glyphs (selected_frame);
   calculate_costs (selected_frame);