division by-zero and senseless negative divisions.
+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>
* configure.ac: Use elf_*_fbsd on kfreebsd.
else
hlheight -= hl_v_pad;
- barwidth = (tracklen * (self->value - self->start)
- / (self->end - self->start));
+ if (self->value <= 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)
{