cedric pushed a commit to branch master.

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

commit 32d1f4b2e5bbdbb3a6bd0f391cf28a7c6ad382dd
Author: Oleksandr Shcherbina <[email protected]>
Date:   Wed Jun 8 13:58:28 2016 -0700

    evas: fix possible memory leaks in e3d_drawable_texture_rendered_pixels_get
    
    Summary:
    @fix
    CID: 1356243, 1356242, 1356242, 1356242
    
    Reviewers: cedric, Hermet, raster
    
    Subscribers: jpeg
    
    Differential Revision: https://phab.enlightenment.org/D4011
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/modules/evas/engines/gl_common/evas_gl_3d.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_3d.c 
b/src/modules/evas/engines/gl_common/evas_gl_3d.c
index 404750a..bb99434 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_3d.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_3d.c
@@ -1460,6 +1460,8 @@ e3d_drawable_texture_rendered_pixels_get(GLuint tex 
EINA_UNUSED, int x, int y, i
    if (!datarowup || !datarowlow)
      {
         ERR("Not enough memory");
+        if (datarowup) free(datarowup);
+        if (datarowlow) free(datarowlow);
         return;
      }
    for (j = 0; j < h / 2; j++)
@@ -1467,7 +1469,7 @@ e3d_drawable_texture_rendered_pixels_get(GLuint tex 
EINA_UNUSED, int x, int y, i
         bellow = h * w - width;
         up = w + width;
 
-        for (i = w; i >= 0; i--)
+        for (i = w - 1; i >= 0; i--)
           {
              pixel = buffer[bellow];
              datarowlow[i] = ((pixel & 0x000000ff) << 16) +

-- 


Reply via email to