animation: don't NULL deref if _run() returns NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
diff --git a/src/animation.c b/src/animation.c
index ee12036..33875d9 100644
--- a/src/animation.c
+++ b/src/animation.c
@@ -262,6 +262,9 @@
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 @@
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 @@
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 @@
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;