summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-10 22:44:47 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-11 12:47:37 +0100
commite0f0165220fe754176ccbbe94c2779a0b8d51d78 (patch)
treee44aa3970c07d23ba3e185acc7e5303941c2f5db /src
parent61be4f02bf92c9a0e9eeff9be40b40196471f044 (diff)
evas - png loader - fix leake in error case of pixels
fix CID 1403027 @fix
Diffstat (limited to '')
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/evas/image_loaders/png/evas_image_load_png.c b/src/modules/evas/image_loaders/png/evas_image_load_png.c
index 732bd94c6a..7b440d5089 100644
--- a/src/modules/evas/image_loaders/png/evas_image_load_png.c
+++ b/src/modules/evas/image_loaders/png/evas_image_load_png.c
@@ -400,6 +400,7 @@ evas_image_load_file_head_with_data_png(void *loader_data,
400 if (nine_patch && pack_offset != sizeof (DATA32)) 400 if (nine_patch && pack_offset != sizeof (DATA32))
401 { 401 {
402 *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 402 *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
403 free(pixels2);
403 goto close_file; 404 goto close_file;
404 } 405 }
405 406
@@ -502,12 +503,14 @@ evas_image_load_file_head_with_data_png(void *loader_data,
502 if (prop->content.x == 0 || prop->content.y == 0) 503 if (prop->content.x == 0 || prop->content.y == 0)
503 { 504 {
504 *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 505 *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
506 free(pixels2);
505 goto close_file; 507 goto close_file;
506 } 508 }
507 if ((prop->content.x + prop->content.w >= image_w - 1) && 509 if ((prop->content.x + prop->content.w >= image_w - 1) &&
508 (prop->content.y + prop->content.h >= image_h - 1)) 510 (prop->content.y + prop->content.h >= image_h - 1))
509 { 511 {
510 *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 512 *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
513 free(pixels2);
511 goto close_file; 514 goto close_file;
512 } 515 }
513 516