2006-05-09 Vesa Jaaskelainen <chaac@nic.fi>
* 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.
This commit is contained in:
parent
83b984def6
commit
31b86e9f3b
2 changed files with 20 additions and 12 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2006-05-09 Vesa Jaaskelainen <chaac@nic.fi>
|
||||||
|
|
||||||
|
* 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 <okuji@enbug.org>
|
2006-05-09 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
* configure.ac (--with-platform): Properly quote the square
|
* configure.ac (--with-platform): Properly quote the square
|
||||||
|
|
|
@ -944,9 +944,9 @@ grub_video_vbe_fill_rect (grub_video_color_t color, int x, int y,
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
/* Make sure there is something to do. */
|
/* 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;
|
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;
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
/* Do not allow drawing out of viewport. */
|
/* 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;
|
unsigned int y_offset = 0;
|
||||||
|
|
||||||
/* Make sure there is something to do. */
|
/* 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;
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
if (y > (int)render_target->viewport.height)
|
if (y >= (int)render_target->viewport.height)
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
/* Calculate glyph dimensions. */
|
/* Calculate glyph dimensions. */
|
||||||
|
@ -1070,9 +1070,9 @@ grub_video_vbe_blit_bitmap (struct grub_video_bitmap * bitmap,
|
||||||
unsigned int width, unsigned int height)
|
unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
/* Make sure there is something to do. */
|
/* 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;
|
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;
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
/* Do not allow drawing out of viewport. */
|
/* 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. */
|
/* Make sure there is something to do. */
|
||||||
if ((width == 0) || (height == 0))
|
if ((width == 0) || (height == 0))
|
||||||
return GRUB_ERR_NONE;
|
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;
|
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;
|
return GRUB_ERR_NONE;
|
||||||
if ((x + (int)source->mode_info.width) < 0)
|
if ((x + (int)source->mode_info.width) < 0)
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
if ((y + (int)source->mode_info.height) < 0)
|
if ((y + (int)source->mode_info.height) < 0)
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
if ((offset_x > (int)source->mode_info.width)
|
if ((offset_x >= (int)source->mode_info.width)
|
||||||
|| (offset_x + (int)source->mode_info.width < 0))
|
|| (offset_x + (int)width < 0))
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
if ((offset_y > (int)source->mode_info.height)
|
if ((offset_y >= (int)source->mode_info.height)
|
||||||
|| (offset_y + (int)source->mode_info.height < 0))
|
|| (offset_y + (int)height < 0))
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
/* If we have negative coordinates, optimize drawing to minimum. */
|
/* If we have negative coordinates, optimize drawing to minimum. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue