Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-10-07 16:36:24 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-10-07 16:39:31 (GMT)
commit978f6b139070be55e0a0c4209fb0af1c288bfd29 (patch)
tree0df29c2987358e0791fc2742b2c828ef54e90125
parentf48de2df96a3de3ce431162970ffe8f54409d44e (diff)
[shell] Make sure total_num_bytes > 0 before using it in progress callbacks
Fixes bgo#597691
-rw-r--r--shell/ev-window.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index d41c847..5e8b248 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1701,6 +1701,9 @@ window_open_file_copy_progress_cb (goffset n_bytes,
if (!ev_window->priv->message_area)
return;
+ if (total_bytes <= 0)
+ return;
+
fraction = n_bytes / (gdouble)total_bytes;
status = g_strdup_printf (_("Downloading document (%d%%)"),
(gint)(fraction * 100));
@@ -1953,7 +1956,10 @@ reload_remote_copy_progress_cb (goffset n_bytes,
if (!ev_window->priv->message_area)
return;
-
+
+ if (total_bytes <= 0)
+ return;
+
fraction = n_bytes / (gdouble)total_bytes;
status = g_strdup_printf (_("Downloading document (%d%%)"),
(gint)(fraction * 100));
@@ -2419,7 +2425,10 @@ window_save_file_copy_progress_cb (goffset n_bytes,
if (!ev_window->priv->message_area)
return;
-
+
+ if (total_bytes <= 0)
+ return;
+
fraction = n_bytes / (gdouble)total_bytes;
save_type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dst), "save-type"));