mirror of https://github.com/zlatinb/muwire
fix integer overflow
parent
d5c92560db
commit
bcce55b873
|
@ -84,7 +84,7 @@ class DownloadSession {
|
||||||
|
|
||||||
log.info("will download piece $piece from position $position steal $steal")
|
log.info("will download piece $piece from position $position steal $steal")
|
||||||
|
|
||||||
long pieceStart = piece * pieceSize
|
long pieceStart = piece * ((long)pieceSize)
|
||||||
long end = Math.min(fileLength, pieceStart + pieceSize) - 1
|
long end = Math.min(fileLength, pieceStart + pieceSize) - 1
|
||||||
long start = pieceStart + position
|
long start = pieceStart + position
|
||||||
String root = Base64.encode(infoHash.getRoot())
|
String root = Base64.encode(infoHash.getRoot())
|
||||||
|
|
Loading…
Reference in New Issue