From 32d1f4b2e5bbdbb3a6bd0f391cf28a7c6ad382dd Mon Sep 17 00:00:00 2001 From: Oleksandr Shcherbina Date: Wed, 8 Jun 2016 13:58:28 -0700 Subject: [PATCH] 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 --- 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 404750a2af..bb99434133 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) +