* grub-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Avoid
division by-zero and senseless negative divisions.
This commit is contained in:
parent
dd7f792c85
commit
bcfa6d72e3
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-11-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Avoid
|
||||||
|
division by-zero and senseless negative divisions.
|
||||||
|
|
||||||
2013-11-08 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-11-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* configure.ac: Use elf_*_fbsd on kfreebsd.
|
* configure.ac: Use elf_*_fbsd on kfreebsd.
|
||||||
|
|
|
@ -169,8 +169,12 @@ draw_pixmap_bar (grub_gui_progress_bar_t self)
|
||||||
else
|
else
|
||||||
hlheight -= hl_v_pad;
|
hlheight -= hl_v_pad;
|
||||||
|
|
||||||
barwidth = (tracklen * (self->value - self->start)
|
if (self->value <= self->start
|
||||||
/ (self->end - self->start));
|
|| self->end <= self->start)
|
||||||
|
barwidth = 0;
|
||||||
|
else
|
||||||
|
barwidth = ((unsigned) (tracklen * (self->value - self->start))
|
||||||
|
/ ((unsigned) (self->end - self->start)));
|
||||||
|
|
||||||
if (barwidth >= hl_h_pad)
|
if (barwidth >= hl_h_pad)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue