animation: don't NULL deref if _run() returns NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
6d71c3c05a
commit
a62e0e0e02
@@ -262,6 +262,9 @@ weston_zoom_run(struct weston_view *view, float start, float stop,
|
|||||||
zoom_frame, reset_alpha,
|
zoom_frame, reset_alpha,
|
||||||
done, data, NULL);
|
done, data, NULL);
|
||||||
|
|
||||||
|
if (zoom == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
weston_spring_init(&zoom->spring, 300.0, start, stop);
|
weston_spring_init(&zoom->spring, 300.0, start, stop);
|
||||||
zoom->spring.friction = 1400;
|
zoom->spring.friction = 1400;
|
||||||
zoom->spring.previous = start - (stop - start) * 0.03;
|
zoom->spring.previous = start - (stop - start) * 0.03;
|
||||||
@@ -291,6 +294,9 @@ weston_fade_run(struct weston_view *view,
|
|||||||
fade_frame, reset_alpha,
|
fade_frame, reset_alpha,
|
||||||
done, data, NULL);
|
done, data, NULL);
|
||||||
|
|
||||||
|
if (fade == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
weston_spring_init(&fade->spring, k, start, end);
|
weston_spring_init(&fade->spring, k, start, end);
|
||||||
|
|
||||||
fade->spring.friction = 1400;
|
fade->spring.friction = 1400;
|
||||||
@@ -337,6 +343,8 @@ weston_stable_fade_run(struct weston_view *front_view, float start,
|
|||||||
stable_fade_frame, NULL,
|
stable_fade_frame, NULL,
|
||||||
done, data, back_view);
|
done, data, back_view);
|
||||||
|
|
||||||
|
if (fade == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
weston_spring_init(&fade->spring, 400, start, end);
|
weston_spring_init(&fade->spring, 400, start, end);
|
||||||
fade->spring.friction = 1150;
|
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,
|
animation = weston_view_animation_run(view, start, end, move_frame,
|
||||||
NULL, move_done, data, move);
|
NULL, move_done, data, move);
|
||||||
|
|
||||||
|
if (animation == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
animation->spring.k = 400;
|
animation->spring.k = 400;
|
||||||
animation->spring.friction = 1150;
|
animation->spring.friction = 1150;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user