Lines Matching +full:address +full:- +full:width
6 The multiplication of 2 unsigned 32-bit integers may overflow before
7 promotion to unsigned 64-bit. We should ensure that the multiplication
13 Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
14 Signed-off-by: Marco A Benatto <mbenatto@redhat.com>
15 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
16 Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
17 ---
18 grub-core/video/fb/fbfill.c | 17 +++++++++++++----
19 1 file changed, 13 insertions(+), 4 deletions(-)
21 diff --git a/grub-core/video/fb/fbfill.c b/grub-core/video/fb/fbfill.c
23 --- a/grub-core/video/fb/fbfill.c
24 +++ b/grub-core/video/fb/fbfill.c
25 @@ -31,6 +31,7 @@
33 @@ -61,7 +62,9 @@ grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst,
37 - rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
38 + if (grub_mul (dst->mode_info->bytes_per_pixel, width, &rowskip) ||
39 + grub_sub (dst->mode_info->pitch, rowskip, &rowskip))
42 /* Get the start address. */
44 @@ -98,7 +101,9 @@ grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst,
48 - rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
49 + if (grub_mul (dst->mode_info->bytes_per_pixel, width, &rowskip) ||
50 + grub_sub (dst->mode_info->pitch, rowskip, &rowskip))
53 /* Get the start address. */
55 @@ -131,7 +136,9 @@ grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst,
59 - rowskip = (dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width);
60 + if (grub_mul (dst->mode_info->bytes_per_pixel, width, &rowskip) ||
61 + grub_sub (dst->mode_info->pitch, rowskip, &rowskip))
64 /* Get the start address. */
66 @@ -161,7 +168,9 @@ grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst,
70 - rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
71 + if (grub_mul (dst->mode_info->bytes_per_pixel, width, &rowskip) ||
72 + grub_sub (dst->mode_info->pitch, rowskip, &rowskip))
75 /* Get the start address. */
77 --