From 5f940c40ed3758a53fedabcd13772c616888efef Mon Sep 17 00:00:00 2001 From: kapodamy Date: Wed, 25 Mar 2020 16:13:36 -0300 Subject: [PATCH] fix integer overflow --- app/src/main/java/us/shandian/giga/get/DownloadRunnable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java b/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java index 4aa6e912e..7fb12d088 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java @@ -70,7 +70,7 @@ public class DownloadRunnable extends Thread { Log.d(TAG, mId + ":acquired block at position=" + block.position + " done=" + block.done); } - long start = block.position * DownloadMission.BLOCK_SIZE; + long start = (long)block.position * DownloadMission.BLOCK_SIZE; long end = start + DownloadMission.BLOCK_SIZE - 1; start += block.done;