diff options
| author | Paul Eggert | 2015-10-28 09:10:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-10-28 09:10:38 -0700 |
| commit | 45cdacb09890121bdcf07279b2fe5bc6a52fa22c (patch) | |
| tree | 1b67deb4f8610387200c9a9bafd5b42ddced5d6c | |
| parent | 020e8505575390ef464b8058d07cee9b161827b1 (diff) | |
| download | emacs-45cdacb09890121bdcf07279b2fe5bc6a52fa22c.tar.gz emacs-45cdacb09890121bdcf07279b2fe5bc6a52fa22c.zip | |
* src/dispnew.c (init_display): Simplify overflow checking.
| -rw-r--r-- | src/dispnew.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 18eed3cfb14..91640769838 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6097,8 +6097,8 @@ init_display (void) | |||
| 6097 | change. It's not clear what better we could do. The rest of | 6097 | change. It's not clear what better we could do. The rest of |
| 6098 | the code assumes that (width + 2) * height * sizeof (struct glyph) | 6098 | the code assumes that (width + 2) * height * sizeof (struct glyph) |
| 6099 | does not overflow and does not exceed PTRDIFF_MAX or SIZE_MAX. */ | 6099 | does not overflow and does not exceed PTRDIFF_MAX or SIZE_MAX. */ |
| 6100 | if (INT_ADD_RANGE_OVERFLOW (width, 2, INT_MIN, INT_MAX) | 6100 | if (INT_ADD_OVERFLOW (width, 2) |
| 6101 | || INT_MULTIPLY_RANGE_OVERFLOW (width + 2, height, INT_MIN, INT_MAX) | 6101 | || INT_MULTIPLY_OVERFLOW (width + 2, height) |
| 6102 | || (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph) | 6102 | || (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (struct glyph) |
| 6103 | < (width + 2) * height)) | 6103 | < (width + 2) * height)) |
| 6104 | fatal ("screen size %dx%d too big", width, height); | 6104 | fatal ("screen size %dx%d too big", width, height); |