From 8853884f2ab64521a3023408a293cc0de0d3d08e Mon Sep 17 00:00:00 2001 From: jsteube Date: Mon, 21 Aug 2017 16:04:43 +0200 Subject: [PATCH] Fix append_four_byte() in case sm8 is 0 --- OpenCL/inc_rp.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenCL/inc_rp.cl b/OpenCL/inc_rp.cl index 0365d59dc..97383fb8c 100644 --- a/OpenCL/inc_rp.cl +++ b/OpenCL/inc_rp.cl @@ -29,6 +29,7 @@ static void append_four_byte (const u32 *buf_src, const int off_src, u32 *buf_ds u64 t64 = hl32_to_64 (buf_src[sd + 1], buf_src[sd + 0]); t64 >>= sm8; + t64 &= 0xffffffff; t64 <<= dm8; const u32 t0 = l32_from_64_S (t64); @@ -107,7 +108,7 @@ static void append_block (const u32 *buf_src, const int off_src, u32 *buf_dst, c { int i; - for (i = 0; i < len - 4; i += 4) + for (i = 0; i < len - 3; i += 4) { append_four_byte (buf_src, off_src + i, buf_dst, off_dst + i); } @@ -116,7 +117,6 @@ static void append_block (const u32 *buf_src, const int off_src, u32 *buf_dst, c switch (left) { - case 4: append_four_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; case 3: append_three_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; case 2: append_two_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; case 1: append_one_byte (buf_src, off_src + i, buf_dst, off_dst + i); break;