summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-05 10:33:28 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-05 10:49:30 -0400
commit6f4f0100d2ebea6d83edab9b4c90a06c98aaf84a (patch)
tree597ac2a6157f9c5bc554e84d236ef8f203b31104
parentfd1c06153bcd7025acd86c519e51eb8a05895de4 (diff)
evas: add a few null checks for e->engine.data.output
this can be null if engine info has not yet been set or if engine info has been unset, leading to engine crashes. instead of adding null checks in every engine, better to add the checks to the originating functions someone with time to kill should go through all the EAPI functions and add more checks
-rw-r--r--src/lib/evas/canvas/evas_font_dir.c13
-rw-r--r--src/lib/evas/canvas/evas_object_image.c10
2 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c
index bfab21f2eb..0f1c27c4ad 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -1469,7 +1469,7 @@ _evas_canvas_font_hinting_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1469EOLIAN Eina_Bool 1469EOLIAN Eina_Bool
1470_evas_canvas_font_hinting_can_hint(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Font_Hinting_Flags hinting) 1470_evas_canvas_font_hinting_can_hint(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Font_Hinting_Flags hinting)
1471{ 1471{
1472 if (e->engine.func->font_hinting_can_hint) 1472 if (e->engine.func->font_hinting_can_hint && e->engine.data.output)
1473 return e->engine.func->font_hinting_can_hint(e->engine.data.output, 1473 return e->engine.func->font_hinting_can_hint(e->engine.data.output,
1474 hinting); 1474 hinting);
1475 else return EINA_FALSE; 1475 else return EINA_FALSE;
@@ -1480,7 +1480,8 @@ _evas_canvas_font_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1480{ 1480{
1481 evas_canvas_async_block(e); 1481 evas_canvas_async_block(e);
1482 evas_render_rendering_wait(e); 1482 evas_render_rendering_wait(e);
1483 e->engine.func->font_cache_flush(e->engine.data.output); 1483 if (e->engine.data.output)
1484 e->engine.func->font_cache_flush(e->engine.data.output);
1484} 1485}
1485 1486
1486EOLIAN void 1487EOLIAN void
@@ -1489,14 +1490,16 @@ _evas_canvas_font_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
1489 if (size < 0) size = 0; 1490 if (size < 0) size = 0;
1490 evas_canvas_async_block(e); 1491 evas_canvas_async_block(e);
1491 evas_render_rendering_wait(e); 1492 evas_render_rendering_wait(e);
1492 e->engine.func->font_cache_set(e->engine.data.output, size); 1493 if (e->engine.data.output)
1494 e->engine.func->font_cache_set(e->engine.data.output, size);
1493} 1495}
1494 1496
1495EOLIAN int 1497EOLIAN int
1496_evas_canvas_font_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) 1498_evas_canvas_font_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1497{ 1499{
1498 return e->engine.func->font_cache_get(e->engine.data.output); 1500 if (e->engine.data.output)
1499 1501 return e->engine.func->font_cache_get(e->engine.data.output);
1502 return -1;
1500} 1503}
1501 1504
1502EOLIAN Eina_List* 1505EOLIAN Eina_List*
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 88fa6b11ae..5b309ddc4f 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1119,7 +1119,8 @@ _evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1119{ 1119{
1120 evas_canvas_async_block(e); 1120 evas_canvas_async_block(e);
1121 evas_render_rendering_wait(e); 1121 evas_render_rendering_wait(e);
1122 e->engine.func->image_cache_flush(e->engine.data.output); 1122 if (e->engine.data.output)
1123 e->engine.func->image_cache_flush(e->engine.data.output);
1123} 1124}
1124 1125
1125EOLIAN void 1126EOLIAN void
@@ -1167,13 +1168,16 @@ _evas_canvas_image_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size
1167 if (size < 0) size = 0; 1168 if (size < 0) size = 0;
1168 evas_canvas_async_block(e); 1169 evas_canvas_async_block(e);
1169 evas_render_rendering_wait(e); 1170 evas_render_rendering_wait(e);
1170 e->engine.func->image_cache_set(e->engine.data.output, size); 1171 if (e->engine.data.output)
1172 e->engine.func->image_cache_set(e->engine.data.output, size);
1171} 1173}
1172 1174
1173EOLIAN int 1175EOLIAN int
1174_evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) 1176_evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1175{ 1177{
1176 return e->engine.func->image_cache_get(e->engine.data.output); 1178 if (e->engine.data.output)
1179 return e->engine.func->image_cache_get(e->engine.data.output);
1180 return -1;
1177} 1181}
1178 1182
1179EOLIAN Eina_Bool 1183EOLIAN Eina_Bool