mirror of
https://github.com/tmux/tmux.git
synced 2026-09-05 21:20:45 +00:00
Avoid overflow in image cell size calculation
This commit is contained in:
4
image.c
4
image.c
@@ -546,8 +546,8 @@ image_size_in_cells(u_int width, u_int height, u_int xpixel, u_int ypixel,
|
||||
xpixel = 8;
|
||||
if (ypixel == 0)
|
||||
ypixel = 16;
|
||||
*sx = ((uint64_t)width + xpixel - 1) / xpixel;
|
||||
*sy = ((uint64_t)height + ypixel - 1) / ypixel;
|
||||
*sx = width / xpixel + (width % xpixel != 0);
|
||||
*sy = height / ypixel + (height % ypixel != 0);
|
||||
}
|
||||
|
||||
/* Return if a screen area contains image markers. */
|
||||
|
||||
Reference in New Issue
Block a user