forked from enlightenment/efl
gesture_manager: Avoid dereferencing null pointer.
Summary: fix coverity report. dereference before null check CID: 1065090 Reviewers: Jaehyun_Cho, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9694
This commit is contained in:
parent
7c08d7b97c
commit
711fffe923
|
@ -161,12 +161,13 @@ _efl_canvas_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_To
|
||||||
{
|
{
|
||||||
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
||||||
Eina_Vector2 vec = { 0, 0 };
|
Eina_Vector2 vec = { 0, 0 };
|
||||||
Eina_Vector2 v1 = { point->cur.pos.x, point->cur.pos.y };
|
|
||||||
Eina_Vector2 v2 = { point->prev.pos.x, point->prev.pos.y };
|
|
||||||
|
|
||||||
if (!point)
|
if (!point)
|
||||||
return vec;
|
return vec;
|
||||||
|
|
||||||
|
Eina_Vector2 v1 = { point->cur.pos.x, point->cur.pos.y };
|
||||||
|
Eina_Vector2 v2 = { point->prev.pos.x, point->prev.pos.y };
|
||||||
|
|
||||||
eina_vector2_subtract(&vec, &v1, &v2);
|
eina_vector2_subtract(&vec, &v1, &v2);
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
@ -176,12 +177,13 @@ _efl_canvas_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture
|
||||||
{
|
{
|
||||||
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
|
||||||
Eina_Vector2 vec = { 0, 0 };
|
Eina_Vector2 vec = { 0, 0 };
|
||||||
Eina_Vector2 v1 = { point->cur.pos.x, point->cur.pos.y };
|
|
||||||
Eina_Vector2 v2 = { point->start.pos.x, point->start.pos.y };
|
|
||||||
|
|
||||||
if (!point)
|
if (!point)
|
||||||
return vec;
|
return vec;
|
||||||
|
|
||||||
|
Eina_Vector2 v1 = { point->cur.pos.x, point->cur.pos.y };
|
||||||
|
Eina_Vector2 v2 = { point->start.pos.x, point->start.pos.y };
|
||||||
|
|
||||||
eina_vector2_subtract(&vec, &v1, &v2);
|
eina_vector2_subtract(&vec, &v1, &v2);
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue