Skip to content

Commit d688554

Browse files
committed
vdisp/gl: process_r10k: ensure proper alignment
fix an alignment warning - check by assert and cast over (void *)
1 parent 428188b commit d688554

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/video_display/gl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,8 +2000,10 @@ static void upload_texture(struct state_gl *s, char *data)
20002000
width = vc_get_linesize(width, s->current_display_desc.color_spec) / 4;
20012001
}
20022002
/// swaps bytes and removes 256B padding
2003-
auto process_r10k = [](uint32_t * __restrict out, const uint32_t *__restrict in, long width, long height) {
2003+
auto process_r10k = [](uint32_t * __restrict out, const void *__restrict in_v, long width, long height) {
20042004
DEBUG_TIMER_START(process_r10k);
2005+
assert((uintptr_t) in_v % 4 == 0);
2006+
const uint32_t *in = (const uint32_t *) in_v;
20052007
long line_padding_b = vc_get_linesize(width, R10k) - 4 * width;
20062008
for (long i = 0; i < height; i += 1) {
20072009
OPTIMIZED_FOR (long j = 0; j < width; j += 1) {

0 commit comments

Comments
 (0)