cursor: Fix alpha mask stride

pull/63/head
Andri Yngvason 2022-02-06 17:44:12 +00:00
parent 9a292afd52
commit 70784e1bcc
1 changed files with 6 additions and 7 deletions

View File

@ -69,15 +69,14 @@ int cursor_encode(struct vec* dst, struct rfb_pixel_format* pixfmt,
dstdata = dst->data; dstdata = dst->data;
dstdata += dst->len; dstdata += dst->len;
if(image->width == image->stride) { for (int y = 0; y < image->height; ++y) {
if (!extract_alpha_mask(dstdata, image->addr, if (!extract_alpha_mask(dstdata + y * UDIV_UP(image->width, 8),
image->fourcc_format, size)) (uint32_t*)image->addr + y * image->stride,
image->fourcc_format, image->width))
return -1; return -1;
} else {
// TODO dst->len += UDIV_UP(image->width, 8);
abort();
} }
dst->len += UDIV_UP(size, 8);
return 0; return 0;
} }