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:00 +0100
commit831406e7128cde5583bb266c054826aace68fbbc (patch)
tree92c512ced82f0c354ebc129fe0996b543ad929b8
parent6b2f60e41a4dff11bb2c08fed433960e72fb8251 (diff)
downloadefl-831406e7128cde5583bb266c054826aace68fbbc.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 21b9498f06..6b858e040f 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -769,8 +769,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))