summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-03-24 23:09:28 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-24 23:11:25 +0100
commit3ab85b3106fbbcdb46aaf90b4e6169cab9467922 (patch)
treec23770c2e0b739853840197f909578ebf742aab7
parentbb30fb6aea2a23017b46375a538b4016472b8da7 (diff)
downloadefl-3ab85b3106fbbcdb46aaf90b4e6169cab9467922.tar.gz
evas: fix use after free.
Thanks to Thanatermesis for tracking this in T2135.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c4
1 files changed, 3 insertions, 1 deletions
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 0bd990a641..3c279acf15 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -763,9 +763,11 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
{
Image_Entry *ie;
if (!im->im) return;
- ie = &im->im->cache_entry;
evas_gl_common_image_alloc_ensure(im);
+ // alloc ensure can change im->im, so only get the local variable later.
+ ie = &im->im->cache_entry;
+
/*
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))