From: Jean-Philippe Andre Date: Thu, 30 Mar 2017 01:26:24 +0000 (+0900) Subject: evas gl: Make sure a deleted image can't be the target X-Git-Tag: upstream/1.20.0~1515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7eb97f3b076e4d51752d3bdb1e68528d5140872;p=platform%2Fupstream%2Fefl.git evas gl: Make sure a deleted image can't be the target If we delete the image that was the target surface for gl rendering, a crash would occur on the next render cycle. Unlikely but not impossible to trigger from app side. @fix --- diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index 4a89ff6..d1feacf 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -769,6 +769,9 @@ evas_gl_common_image_free(Evas_GL_Image *im) im->references--; if (im->references > 0) return; + if (im->gc && (im->gc->pipe[0].shader.surface == im)) + evas_gl_common_context_target_surface_set(im->gc, im->gc->def_surface); + if (im->fglyph) { im->gc->font_glyph_images = eina_list_remove(im->gc->font_glyph_images, im);