summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-01-31 21:34:49 +0900
committerHermet Park <hermetpark@gmail.com>2020-01-31 21:35:18 +0900
commite0b4ddaeb8c266e4a499984138c5bcd8f958645b (patch)
tree8ff4850635cf2237f4a2d737a3c020c553cdf602
parent4697438b26fb22d93b332baac7fd30f8863d1851 (diff)
evas filter: fix crash issue
Summary: If image object geometry is same with image size, then a crash occurs on both GL and SW engine. [Test Code] evas_object_image_size_get(img, &w, &h); evas_object_resize(img, w, h); [GL engine] eng_ector_buffer_wrap should use output instead of engine for calling evas_ector_buffer_engine_image, because it expects the output not the engine. [SW engine] eng_ector_buffer_wrap should check if im->image.data is NULL because _evas_ector_software_buffer_evas_ector_buffer_engine_image_set returns before calling evas_cache_iamge_ref if im->image.data is NULL, and it causes a segmentation fault finally with following backtrace. (#0) evas_cache_image_drop (im=0x0) (#1) _evas_ector_software_buffer_efl_object_destructor (#2) efl_destructor (#3) _efl_del_internal (#4) _efl_unref_internal (#5) _efl_add_internal_end (#6) _efl_add_end (#7) eng_ector_buffer_wrap Test Plan: {F3841366} Reviewers: Hermet, jsuya Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11258
-rw-r--r--src/lib/evas/filters/evas_filter.c2
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c5
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index c9d8005e26..a35ad8131f 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -608,6 +608,8 @@ evas_filter_buffer_backing_set(Evas_Filter_Context *ctx, int bufid,
608 if (fb->is_render) goto end; 608 if (fb->is_render) goto end;
609 609
610 buffer = ENFN->ector_buffer_wrap(ENC, ctx->evas->evas, engine_buffer); 610 buffer = ENFN->ector_buffer_wrap(ENC, ctx->evas->evas, engine_buffer);
611 if (!buffer) return EINA_FALSE;
612
611 ret = EINA_TRUE; 613 ret = EINA_TRUE;
612 614
613end: 615end:
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index ec14e2bacc..5514b7d97d 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2564,11 +2564,14 @@ static Ector_Buffer *
2564eng_ector_buffer_wrap(void *engine EINA_UNUSED, Evas *evas, void *engine_image) 2564eng_ector_buffer_wrap(void *engine EINA_UNUSED, Evas *evas, void *engine_image)
2565{ 2565{
2566 Evas_GL_Image *im = engine_image; 2566 Evas_GL_Image *im = engine_image;
2567 Render_Output_GL_Generic *output;
2567 2568
2568 EINA_SAFETY_ON_NULL_RETURN_VAL(engine_image, NULL); 2569 EINA_SAFETY_ON_NULL_RETURN_VAL(engine_image, NULL);
2570 output = _evgl_output_find(engine);
2571 if (!output) return NULL;
2569 2572
2570 return efl_add(EVAS_ECTOR_GL_IMAGE_BUFFER_CLASS, evas, 2573 return efl_add(EVAS_ECTOR_GL_IMAGE_BUFFER_CLASS, evas,
2571 evas_ector_buffer_engine_image_set(efl_added, evas, im)); 2574 evas_ector_buffer_engine_image_set(efl_added, output, im));
2572} 2575}
2573 2576
2574//FIXME: Currently Ector GL doens't work properly. Use software instead. 2577//FIXME: Currently Ector GL doens't work properly. Use software instead.
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index b548322539..44c169c781 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4275,8 +4275,10 @@ eng_ector_buffer_wrap(void *data, Evas *e EINA_UNUSED, void *engine_image)
4275{ 4275{
4276 Image_Entry *ie = engine_image; 4276 Image_Entry *ie = engine_image;
4277 Ector_Buffer *buf = NULL; 4277 Ector_Buffer *buf = NULL;
4278 RGBA_Image *im = (RGBA_Image *)ie;
4278 4279
4279 if (!ie) return NULL; 4280 if (!ie) return NULL;
4281 if (!im->image.data) return NULL;
4280 4282
4281 if (!efl_domain_current_push(EFL_ID_DOMAIN_SHARED)) 4283 if (!efl_domain_current_push(EFL_ID_DOMAIN_SHARED))
4282 return NULL; 4284 return NULL;