From: Richard M. Stallman Date: Mon, 20 Jan 1997 01:21:07 +0000 (+0000) Subject: (init_display): Check for overflow in screen size. X-Git-Tag: emacs-20.1~3053 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d86c299a5f59a540fcf20a3604f626dc4235f29c;p=emacs.git (init_display): Check for overflow in screen size. --- diff --git a/src/dispnew.c b/src/dispnew.c index 90d9fc2fc55..0301c57cb19 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2549,6 +2549,22 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ 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);