summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf_evas
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2015-03-24 20:33:45 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2015-03-24 20:33:45 +0900
commit56dc26f0b9bd59e7534561ebc450942b0f59b8d8 (patch)
treefdcd0128247e348f49a74446eda1f268727191b6 /src/lib/ecore_imf_evas
parentb8b6c1e1a8dd461026c47f316475f2812d32eeb0 (diff)
ecore_imf: Add NULL check before accessing evas device API
Diffstat (limited to 'src/lib/ecore_imf_evas')
-rw-r--r--src/lib/ecore_imf_evas/ecore_imf_evas.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/lib/ecore_imf_evas/ecore_imf_evas.c b/src/lib/ecore_imf_evas/ecore_imf_evas.c
index 69de93d92f..1f213d624e 100644
--- a/src/lib/ecore_imf_evas/ecore_imf_evas.c
+++ b/src/lib/ecore_imf_evas/ecore_imf_evas.c
@@ -184,9 +184,20 @@ ecore_imf_evas_event_key_down_wrap(Evas_Event_Key_Down *evas_event,
184 imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty; 184 imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty;
185 imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty; 185 imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty;
186 imf_event->timestamp = evas_event->timestamp; 186 imf_event->timestamp = evas_event->timestamp;
187 imf_event->dev_name = evas_device_name_get(evas_event->dev) ? evas_device_name_get(evas_event->dev) : _ecore_imf_evas_event_empty; 187
188 imf_event->dev_class = evas_device_class_get(evas_event->dev); 188 if (evas_event->dev)
189 imf_event->dev_subclass = evas_device_subclass_get(evas_event->dev); 189 {
190 imf_event->dev_name = evas_device_name_get(evas_event->dev) ? evas_device_name_get(evas_event->dev) : _ecore_imf_evas_event_empty;
191 imf_event->dev_class = evas_device_class_get(evas_event->dev);
192 imf_event->dev_subclass = evas_device_subclass_get(evas_event->dev);
193 }
194 else
195 {
196 imf_event->dev_name = _ecore_imf_evas_event_empty;
197 imf_event->dev_class = ECORE_IMF_DEVICE_CLASS_NONE;
198 imf_event->dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
199 }
200
190 _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); 201 _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers);
191 _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); 202 _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks);
192} 203}
@@ -212,9 +223,20 @@ ecore_imf_evas_event_key_up_wrap(Evas_Event_Key_Up *evas_event,
212 imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty; 223 imf_event->string = evas_event->string ? evas_event->string : _ecore_imf_evas_event_empty;
213 imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty; 224 imf_event->compose = evas_event->compose ? evas_event->compose : _ecore_imf_evas_event_empty;
214 imf_event->timestamp = evas_event->timestamp; 225 imf_event->timestamp = evas_event->timestamp;
215 imf_event->dev_name = evas_device_name_get(evas_event->dev) ? evas_device_name_get(evas_event->dev) : _ecore_imf_evas_event_empty; 226
216 imf_event->dev_class = evas_device_class_get(evas_event->dev); 227 if (evas_event->dev)
217 imf_event->dev_subclass = evas_device_subclass_get(evas_event->dev); 228 {
229 imf_event->dev_name = evas_device_name_get(evas_event->dev) ? evas_device_name_get(evas_event->dev) : _ecore_imf_evas_event_empty;
230 imf_event->dev_class = evas_device_class_get(evas_event->dev);
231 imf_event->dev_subclass = evas_device_subclass_get(evas_event->dev);
232 }
233 else
234 {
235 imf_event->dev_name = _ecore_imf_evas_event_empty;
236 imf_event->dev_class = ECORE_IMF_DEVICE_CLASS_NONE;
237 imf_event->dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
238 }
239
218 _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers); 240 _ecore_imf_evas_event_modifiers_wrap(evas_event->modifiers, &imf_event->modifiers);
219 _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks); 241 _ecore_imf_evas_event_locks_wrap(evas_event->locks, &imf_event->locks);
220} 242}