|| 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. */
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;
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);