emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android 787c947028c 5/7: ; * src/android.c (android_blit_copy):


From: Po Lu
Subject: feature/android 787c947028c 5/7: ; * src/android.c (android_blit_copy): Fix typos.
Date: Mon, 29 May 2023 06:07:13 -0400 (EDT)

branch: feature/android
commit 787c947028c0ffd0ebe31cd675c976049cc9777c
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    ; * src/android.c (android_blit_copy): Fix typos.
---
 src/android.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/android.c b/src/android.c
index 4184be3086b..9674fda36d8 100644
--- a/src/android.c
+++ b/src/android.c
@@ -4206,9 +4206,12 @@ android_blit_copy (int src_x, int src_y, int width, int 
height,
              || INT_ADD_WRAPV ((uintptr_t) mask, offset, &start))
            return;
 
+         if (height <= 0)
+           return;
+
          mask = mask_current = (unsigned char *) start;
 
-         while (--height)
+         while (height--)
            {
              /* Skip backwards past the end of the mask.  */
 
@@ -4277,12 +4280,12 @@ android_blit_copy (int src_x, int src_y, int width, int 
height,
          else
            temp = MIN (mask_info->width, width);
 
-         if (temp <= 0)
+         if (temp <= 0 || height <= 0)
            return;
 
          /* Copy bytes according to the mask.  */
 
-         while (--height)
+         while (height--)
            {
              long_src = (unsigned int *) src_current;
              long_dst = (unsigned int *) dst_current;
@@ -4292,11 +4295,12 @@ android_blit_copy (int src_x, int src_y, int width, int 
height,
              while (temp--)
                {
                  /* Sign extend the mask.  */
-                 height = *(signed char *) mask_current++;
+                 i = *(signed char *) mask_current++;
 
                  /* Apply the mask.  */
-                 *long_dst = ((*long_src & height)
-                              | (*long_dst & ~height));
+                 *long_dst = ((*long_src & i) | (*long_dst & ~i));
+                 long_dst++;
+                 long_src++;
                }
 #else /* __aarch64__ */
              android_neon_mask_line (long_src, long_dst, mask, temp);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]