diff options
author | Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> | 2013-02-06 18:36:45 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-02-06 18:36:45 +0000 |
commit | f294976a1055d4f88edebe97e606e1f4bcc32c8e (patch) | |
tree | dc1580c4a3f4bfc2483fcd4da5eccd49df736974 /src | |
parent | 22a384d76cad4f921d7d51240cdc7c623cda03e1 (diff) | |
parent | f81bc0d3747f5ef86254a5597562ce1bb425eb97 (diff) | |
download | ayatana-ido-f294976a1055d4f88edebe97e606e1f4bcc32c8e.tar.gz ayatana-ido-f294976a1055d4f88edebe97e606e1f4bcc32c8e.tar.bz2 ayatana-ido-f294976a1055d4f88edebe97e606e1f4bcc32c8e.zip |
Fix building against gtest/xorg-gtest. Fixes: https://bugs.launchpad.net/bugs/1112775.
Approved by Charles Kerr, PS Jenkins bot.
Diffstat (limited to 'src')
-rw-r--r-- | src/idotimeline.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/idotimeline.c b/src/idotimeline.c index 24a6935..8eea4b5 100644 --- a/src/idotimeline.c +++ b/src/idotimeline.c @@ -409,8 +409,8 @@ ido_timeline_start (IdoTimeline *timeline) else priv->timer = g_timer_new (); - /* sanity check */ - g_assert (priv->fps > 0); + /* sanity check; CID: 12651 */ + priv->fps = priv->fps > 0 ? priv->fps : DEFAULT_FPS; if (priv->screen) { @@ -549,7 +549,8 @@ ido_timeline_set_fps (IdoTimeline *timeline, priv = IDO_TIMELINE_GET_PRIV (timeline); - priv->fps = fps; + /* Coverity CID: 12650/12651: guard against division by 0. */ + priv->fps = fps > 0 ? fps : priv->fps; if (ido_timeline_is_running (timeline)) { |