cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=dd6db2b603685bb9a5c05d025f6587e5b8657581

commit dd6db2b603685bb9a5c05d025f6587e5b8657581
Author: Cedric BAIL <[email protected]>
Date:   Tue Mar 24 23:09:28 2015 +0100

    evas: fix use after free.
    
    Thanks to Thanatermesis for tracking this in T2135.
---
 src/modules/evas/engines/gl_common/evas_gl_image.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 b8076a0..ff415ba 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -770,9 +770,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))

-- 


Reply via email to