Fix a missed check for division by zero. (#77820, Gareth Pearce)

Thu May 16 12:56:38 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
        check for division by zero. (#77820, Gareth Pearce)
This commit is contained in:
Owen Taylor 2002-05-16 16:57:18 +00:00 committed by Owen Taylor
parent bcce8104ef
commit ce5029dfa9
7 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com> Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb): * gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb):

View File

@ -1,3 +1,8 @@
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com> Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb): * gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb):

View File

@ -1,3 +1,8 @@
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com> Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb): * gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb):

View File

@ -1,3 +1,8 @@
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com> Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb): * gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb):

View File

@ -1,3 +1,8 @@
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com> Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb): * gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb):

View File

@ -1,3 +1,8 @@
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed
check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com> Thu May 16 12:50:13 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb): * gdk/x11/gdkevents-x11.c (gdk_xsettings_notify_cb):

View File

@ -2181,8 +2181,12 @@ gtk_range_calc_layout (GtkRange *range,
/* slider width is the fraction (page_size / /* slider width is the fraction (page_size /
* total_adjustment_range) times the trough width in pixels * total_adjustment_range) times the trough width in pixels
*/ */
width = ((right - left) * (range->adjustment->page_size /
if (range->adjustment->upper - range->adjustment->lower != 0)
width = ((right - left) * (range->adjustment->page_size /
(range->adjustment->upper - range->adjustment->lower))); (range->adjustment->upper - range->adjustment->lower)));
else
width = range->min_slider_size;
if (width < range->min_slider_size || if (width < range->min_slider_size ||
range->slider_size_fixed) range->slider_size_fixed)