Commit d86c299a authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(init_display): Check for overflow in screen size.

parent 5fba49f0
......@@ -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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment