From 337440d4a0f141c036e057ecc4fe4f4b808ff9c0 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 15 Sep 2017 19:52:49 -0700 Subject: modules/*: cease dividing stride by 4 Just cast buf to (void *) for the pointer arithmetic, stride is in units of bytes and no assumptions should be made about its value such as divisability by 4. --- src/modules/plasma/plasma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/plasma') diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c index 71c5c13..245cf3c 100644 --- a/src/modules/plasma/plasma.c +++ b/src/modules/plasma/plasma.c @@ -89,7 +89,7 @@ static void plasma_prepare_frame(void *context, unsigned n_cpus, fb_fragment_t * static void plasma_render_fragment(void *context, fb_fragment_t *fragment) { plasma_context_t *ctxt = context; - unsigned stride = fragment->stride / 4, width = fragment->width, height = fragment->height; + unsigned width = fragment->width, height = fragment->height; int fw2 = FIXED_NEW(width / 2), fh2 = FIXED_NEW(height / 2); int x, y, cx, cy, dx2, dy2; uint32_t *buf = fragment->buf; @@ -148,7 +148,7 @@ static void plasma_render_fragment(void *context, fb_fragment_t *fragment) *buf = color2pixel(&c); } - buf += stride; + buf = ((void *)buf) + fragment->stride; } } -- cgit v1.2.1