From: chaac Date: Tue, 9 May 2006 20:11:11 +0000 (+0000) Subject: 2006-05-09 Vesa Jaaskelainen X-Git-Tag: 1.98~1967 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31b86e9f3b61887eee3f9cc76578db062bada0d2;p=thirdparty%2Fgrub.git 2006-05-09 Vesa Jaaskelainen * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Corrected bounds checking. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_blit_bitmap): Likewise. (grub_video_vbe_blit_render_target): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 26e4006d1..f51ac1a36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-09 Vesa Jaaskelainen + + * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Corrected bounds + checking. + (grub_video_vbe_blit_glyph): Likewise. + (grub_video_vbe_blit_bitmap): Likewise. + (grub_video_vbe_blit_render_target): Likewise. + 2006-05-09 Yoshinori K. Okuji * configure.ac (--with-platform): Properly quote the square diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index f92c130d7..f36fbdbbf 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -944,9 +944,9 @@ grub_video_vbe_fill_rect (grub_video_color_t color, int x, int y, unsigned int i, j; /* Make sure there is something to do. */ - if ((x > (int)render_target->viewport.width) || (x + (int)width < 0)) + if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) return GRUB_ERR_NONE; - if ((y > (int)render_target->viewport.height) || (y + (int)height < 0)) + if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) return GRUB_ERR_NONE; /* Do not allow drawing out of viewport. */ @@ -1013,10 +1013,10 @@ grub_video_vbe_blit_glyph (struct grub_font_glyph * glyph, unsigned int y_offset = 0; /* Make sure there is something to do. */ - if (x > (int)render_target->viewport.width) + if (x >= (int)render_target->viewport.width) return GRUB_ERR_NONE; - if (y > (int)render_target->viewport.height) + if (y >= (int)render_target->viewport.height) return GRUB_ERR_NONE; /* Calculate glyph dimensions. */ @@ -1070,9 +1070,9 @@ grub_video_vbe_blit_bitmap (struct grub_video_bitmap * bitmap, unsigned int width, unsigned int height) { /* Make sure there is something to do. */ - if ((x > (int)render_target->viewport.width) || (x + (int)width < 0)) + if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) return GRUB_ERR_NONE; - if ((y > (int)render_target->viewport.height) || (y + (int)height < 0)) + if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) return GRUB_ERR_NONE; /* Do not allow drawing out of viewport. */ @@ -1130,19 +1130,19 @@ grub_video_vbe_blit_render_target (struct grub_video_render_target *source, /* Make sure there is something to do. */ if ((width == 0) || (height == 0)) return GRUB_ERR_NONE; - if ((x > (int)render_target->viewport.width) || (x + (int)width < 0)) + if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) return GRUB_ERR_NONE; - if ((y > (int)render_target->viewport.height) || (y + (int)height < 0)) + if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) return GRUB_ERR_NONE; if ((x + (int)source->mode_info.width) < 0) return GRUB_ERR_NONE; if ((y + (int)source->mode_info.height) < 0) return GRUB_ERR_NONE; - if ((offset_x > (int)source->mode_info.width) - || (offset_x + (int)source->mode_info.width < 0)) + if ((offset_x >= (int)source->mode_info.width) + || (offset_x + (int)width < 0)) return GRUB_ERR_NONE; - if ((offset_y > (int)source->mode_info.height) - || (offset_y + (int)source->mode_info.height < 0)) + if ((offset_y >= (int)source->mode_info.height) + || (offset_y + (int)height < 0)) return GRUB_ERR_NONE; /* If we have negative coordinates, optimize drawing to minimum. */