This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 5c0c98428d186a8e8f266e27fbfa7439e2b7f7d9
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sun May 7 10:10:45 2023 +0200

    scaling: Correct scaleinfo array length
    
    The +1 length may have been used in the old OLD_SCALE_DOWN case.
---
 src/lib/scale.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/scale.c b/src/lib/scale.c
index 83f5a1c..0cc7d4d 100644
--- a/src/lib/scale.c
+++ b/src/lib/scale.c
@@ -35,7 +35,7 @@ __imlib_CalcYPoints(uint32_t * src, int sw, int sh, int dh, int b1, int b2)
         rv = 1;
      }
 
-   p = malloc((dh + 1) * sizeof(uint32_t *));
+   p = malloc(dh * sizeof(uint32_t *));
    if (!p)
       return NULL;
 
@@ -66,7 +66,7 @@ __imlib_CalcYPoints(uint32_t * src, int sw, int sh, int dh, int b1, int b2)
      }
    val = (sh - b2) << 16;
    inc = 1 << 16;
-   for (i = 0; i <= b2; i++)
+   for (i = 0; i < b2; i++)
      {
         p[j++] = src + ((val >> 16) * sw);
         val += inc;
@@ -95,7 +95,7 @@ __imlib_CalcXPoints(int sw, int dw, int b1, int b2)
         rv = 1;
      }
 
-   p = malloc((dw + 1) * sizeof(int));
+   p = malloc(dw * sizeof(int));
    if (!p)
       return NULL;
 
@@ -126,7 +126,7 @@ __imlib_CalcXPoints(int sw, int dw, int b1, int b2)
      }
    val = (sw - b2) << 16;
    inc = 1 << 16;
-   for (i = 0; i <= b2; i++)
+   for (i = 0; i < b2; i++)
      {
         p[j++] = (val >> 16);
         val += inc;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to