evas: fixed region issue in png file 90/294290/1
authorMichal Szczecinski <m.szczecinsk@partner.samsung.com>
Thu, 15 Jun 2023 15:41:57 +0000 (17:41 +0200)
committerMichal Szczecinski <m.szczecinsk@partner.samsung.com>
Thu, 15 Jun 2023 15:45:43 +0000 (17:45 +0200)
Change-Id: I5ee32dba41887e09ec741bb1dd572af163e3d622

src/modules/evas/image_loaders/png/evas_image_load_png.c

index edc14d8..c85438a 100644 (file)
@@ -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