From 65e18726c1de52f7fe23e14e59a15dc7e04cb017 Mon Sep 17 00:00:00 2001 From: Michal Szczecinski Date: Thu, 15 Jun 2023 17:41:57 +0200 Subject: [PATCH] evas: fixed region issue in png file Change-Id: I5ee32dba41887e09ec741bb1dd572af163e3d622 --- src/modules/evas/image_loaders/png/evas_image_load_png.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 edc14d8..c85438a 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 @@ -263,11 +263,11 @@ _evas_image_load_file_internal_head_png(Loader_Info *loader, (epi->w32 > IMG_MAX_SIZE) || (epi->h32 > IMG_MAX_SIZE) || IMG_TOO_BIG(epi->w32, epi->h32)) { - if (IMG_TOO_BIG(epi->w32, epi->h32)) - *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - else - *error = EVAS_LOAD_ERROR_GENERIC; - goto close_file; + if (IMG_TOO_BIG(epi->w32, epi->h32)) + *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; + else + *error = EVAS_LOAD_ERROR_GENERIC; + goto close_file; } if (opts->emile.region.w > 0 && opts->emile.region.h > 0) @@ -1092,7 +1092,7 @@ evas_image_load_file_data_png(void *loader_data, ++dst_ptr; src_ptr2 += scale_ratio; } - src_ptr2 += scale_ratio * image_w; + src_ptr2 += (scale_ratio * image_w) - w; } } else -- 2.7.4