aboutsummaryrefslogtreecommitdiff
path: root/src/idotimeline.c
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu-tl@ubuntu.com>2013-02-06 18:36:45 +0000
committerTarmac <Unknown>2013-02-06 18:36:45 +0000
commitf294976a1055d4f88edebe97e606e1f4bcc32c8e (patch)
treedc1580c4a3f4bfc2483fcd4da5eccd49df736974 /src/idotimeline.c
parent22a384d76cad4f921d7d51240cdc7c623cda03e1 (diff)
parentf81bc0d3747f5ef86254a5597562ce1bb425eb97 (diff)
downloadayatana-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/idotimeline.c')
-rw-r--r--src/idotimeline.c7
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))
{