Fix Valgrind issue

It was complaining of an invalid read size because it was accessing
bytes after the pixels buffer.
master
Daniel Zaoui 4 years ago
parent 667171d1d9
commit a1341ac74c
  1. 4
      src/lib/unit.c

@ -339,8 +339,8 @@ exactness_image_compare(Exactness_Image *img1, Exactness_Image *img2, Exactness_
{
for (h = 0; h < hO; h++)
{
Eina_Bool valid1 = img1 ? w <= w1 && h <= h1 : EINA_FALSE;
Eina_Bool valid2 = img2 ? w <= w2 && h <= h2 : EINA_FALSE;
Eina_Bool valid1 = img1 ? w < w1 && h < h1 : EINA_FALSE;
Eina_Bool valid2 = img2 ? w < w2 && h < h2 : EINA_FALSE;
int px1 = valid1 ? pxs1[h * w1 + w] : 0;
int px2 = valid2 ? pxs2[h * w2 + w] : 0;
int r1 = (px1 & 0x00FF0000) >> 16;

Loading…
Cancel
Save