From 26c5b76037fc00f13922e7d1433c214428d4fec2 Mon Sep 17 00:00:00 2001 From: Lephe Date: Wed, 4 May 2022 17:17:18 +0100 Subject: [PATCH] render-cg: round RGB16 images to even widths --- src/render-cg/bopti.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/render-cg/bopti.c b/src/render-cg/bopti.c index 4d49d2b..1e13c9b 100644 --- a/src/render-cg/bopti.c +++ b/src/render-cg/bopti.c @@ -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);