live_edit: Prevent memory overflow case.

Emum value Ctrl_Pt_Cnt is only used to set array size.
Therefore, Ctrl_Pt_Cnt should not be used as an index value.

@fix
This commit is contained in:
Jaehyun Cho 2016-03-07 16:56:31 +09:00
parent 49fae1fe40
commit d64c7ca196
1 changed files with 1 additions and 2 deletions

View File

@ -563,6 +563,7 @@ cp_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
//Dispatch to actual mouse move call
Ctrl_Pt cp = (Ctrl_Pt) evas_object_data_get(obj, "index");
if (cp == Ctrl_Pt_Cnt) return; //not to use Ctrl_Pt_Cnt as index.
//Show Control Point
live_data *ld = data;
@ -594,8 +595,6 @@ cp_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
case Ctrl_Pt_Right:
cp_right_mouse_move_cb(data, e, obj, event_info);
break;
case Ctrl_Pt_Cnt: //for avoiding compiler warning.
break;
}
live_edit_update_internal(ld);
}