Avoid 64 bit mod operation, which won't work on 32 bit systems.
Simple subtraction can be used instead in this case.
Reported-By: Fengguang Wu <[email protected]>
Signed-off-by: Dan Streetman <[email protected]>
---
lib/842/842_decompress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c
index dbeb058..999b629 100644
--- a/lib/842/842_decompress.c
+++ b/lib/842/842_decompress.c
@@ -185,7 +185,7 @@ static int __do_index(struct sw842_param *p, u8 size, u8 bits, u64 fsize)
/* this is where the current fifo is */
u64 section = round_down(total, fsize);
/* the current pos in the fifo */
- u64 pos = total % fsize;
+ u64 pos = total - section;
/* if the offset is past/at the pos, we need to
* go back to the last fifo section
--
2.1.0
On Mon, May 11, 2015 at 06:53:36PM -0400, Dan Streetman wrote:
> Avoid 64 bit mod operation, which won't work on 32 bit systems.
> Simple subtraction can be used instead in this case.
>
> Reported-By: Fengguang Wu <[email protected]>
> Signed-off-by: Dan Streetman <[email protected]>
Applied.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt