aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-01-20 01:21:07 +0000
committerRichard M. Stallman1997-01-20 01:21:07 +0000
commitd86c299a5f59a540fcf20a3604f626dc4235f29c (patch)
tree23255a11c8737a62dbdd64d67ce4ba94bbbcc033
parent5fba49f0cde98a8210ffc80e01e8de1e6868a9fe (diff)
downloademacs-d86c299a5f59a540fcf20a3604f626dc4235f29c.tar.gz
emacs-d86c299a5f59a540fcf20a3604f626dc4235f29c.zip
(init_display): Check for overflow in screen size.
-rw-r--r--src/dispnew.c16
1 files changed, 16 insertions, 0 deletions
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\
2549 2549
2550 term_init (terminal_type); 2550 term_init (terminal_type);
2551 2551
2552 {
2553 int width = FRAME_WINDOW_WIDTH (selected_frame);
2554 int height = FRAME_HEIGHT (selected_frame);
2555
2556 unsigned int total_glyphs = height * (width + 2) * sizeof (GLYPH);
2557
2558 /* If these sizes are so big they cause overflow,
2559 just ignore the change. It's not clear what better we could do. */
2560 if (total_glyphs / sizeof (GLYPH) / height != width + 2)
2561 {
2562 fprintf (stderr, "emacs: screen size %dx%d too big\n,",
2563 width, height);
2564 exit (1);
2565 }
2566 }
2567
2552 remake_frame_glyphs (selected_frame); 2568 remake_frame_glyphs (selected_frame);
2553 calculate_costs (selected_frame); 2569 calculate_costs (selected_frame);
2554 2570