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:13:42 +0100
commitf7a971db13793f4049d875a24cade7433bb99ec6 (patch)
tree545d85c25dd9565fefbe2f86ecea196b7cfa959d
parent77bc93e37dd482fcbec62472054b17638d3952ae (diff)
downloadefl-f7a971db13793f4049d875a24cade7433bb99ec6.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.c5
1 files changed, 4 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 169b48655f..7b30f52c85 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -660,8 +660,11 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
{
Image_Entry *ie;
if (!im->im) return;
- ie = (Image_Entry *)(im->im);
evas_gl_common_image_alloc_ensure(im);
+
+ // alloc ensure can change im->im, so only get the local variable later.
+ ie = (Image_Entry *)(im->im);
+
/*
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))