summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2014-01-17 15:08:51 -0800
committerKristian Høgsberg <krh@bitplanet.net>2014-01-19 22:17:15 -0800
commita62e0e0e02b83d10a2ba1f005ee5bac938f3ea03 (patch)
tree13c6f972cedc8d490cfe11b2478215b91080ee88
parent6d71c3c05ab1acf013353d8496aae8e2a8bc44d3 (diff)
animation: don't NULL deref if _run() returns NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
-rw-r--r--src/animation.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/animation.c b/src/animation.c
index ee120367..33875d99 100644
--- a/src/animation.c
+++ b/src/animation.c
@@ -262,6 +262,9 @@ weston_zoom_run(struct weston_view *view, float start, float stop,
zoom_frame, reset_alpha,
done, data, NULL);
+ if (zoom == NULL)
+ return NULL;
+
weston_spring_init(&zoom->spring, 300.0, start, stop);
zoom->spring.friction = 1400;
zoom->spring.previous = start - (stop - start) * 0.03;
@@ -291,6 +294,9 @@ weston_fade_run(struct weston_view *view,
fade_frame, reset_alpha,
done, data, NULL);
+ if (fade == NULL)
+ return NULL;
+
weston_spring_init(&fade->spring, k, start, end);
fade->spring.friction = 1400;
@@ -337,6 +343,8 @@ weston_stable_fade_run(struct weston_view *front_view, float start,
stable_fade_frame, NULL,
done, data, back_view);
+ if (fade == NULL)
+ return NULL;
weston_spring_init(&fade->spring, 400, start, end);
fade->spring.friction = 1150;
@@ -434,6 +442,10 @@ weston_move_scale_run(struct weston_view *view, int dx, int dy,
animation = weston_view_animation_run(view, start, end, move_frame,
NULL, move_done, data, move);
+
+ if (animation == NULL)
+ return NULL;
+
animation->spring.k = 400;
animation->spring.friction = 1150;