render-cg: round RGB16 images to even widths

This commit is contained in:
Lephe 2022-05-04 17:17:18 +01:00
parent e57efb5e37
commit 26c5b76037
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 3 additions and 2 deletions

View File

@ -33,9 +33,10 @@ void bopti_render(bopti_image_t const *img, struct box *box)
if(profile == PX_R5G6B5 || profile == PX_R5G6B5A)
{
/* Input stride */
int in = 2 * (img->width - w);
int true_width = img->width + (img->width & 1);
int in = 2 * (true_width - w);
data += 2 * (img->width * box->top + box->left);
data += 2 * (true_width * box->top + box->left);
if(profile == PX_R5G6B5)
bopti_r5g6b5(data, target, w, h, in, out);