[gnome-shell/wip/bg-fixes: 6/6] background: don't choke on huge slide show durations



commit bf8993796ddb2bae158aa0dfda8dc18748457bca
Author: Ray Strode <rstrode redhat com>
Date:   Mon Mar 25 10:42:21 2013 -0400

    background: don't choke on huge slide show durations
    
    if a slideshow file has a really large duration we'll currently
    throw an exception.
    
    This bug is aggravated by the fact that some versions of
    gnome-desktop use UINT_MAX as a sentinel value to mean,
    "don't ever update slide".
    
    This commit treats durations that would overflow as infinitely
    long.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696157

 js/ui/background.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 2625452..8c2870c 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -503,6 +503,10 @@ const Background = new Lang.Class({
 
         let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000,
                                 timePerStep);
+
+        if (interval > GLib.MAXUINT32)
+            return;
+
         this._updateAnimationTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
                                                       interval,
                                                       Lang.bind(this, function() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]