mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 20:14:51 +00:00
total_done overflow fix in libtorrent
This commit is contained in:
parent
e32f603103
commit
6953e280ad
1 changed files with 3 additions and 3 deletions
|
@ -704,7 +704,7 @@ namespace libtorrent
|
|||
const int last_piece = m_torrent_file->num_pieces() - 1;
|
||||
|
||||
size_type total_done
|
||||
= m_num_pieces * m_torrent_file->piece_length();
|
||||
= size_type(m_num_pieces) * m_torrent_file->piece_length();
|
||||
|
||||
// if we have the last piece, we have to correct
|
||||
// the amount we have, since the first calculation
|
||||
|
@ -735,11 +735,11 @@ namespace libtorrent
|
|||
return make_tuple(m_torrent_file->total_size()
|
||||
, m_torrent_file->total_size());
|
||||
|
||||
size_type wanted_done = (m_num_pieces - m_picker->num_have_filtered())
|
||||
size_type wanted_done = size_type(m_num_pieces - m_picker->num_have_filtered())
|
||||
* piece_size;
|
||||
|
||||
size_type total_done
|
||||
= m_num_pieces * piece_size;
|
||||
= size_type(m_num_pieces) * piece_size;
|
||||
TORRENT_ASSERT(m_num_pieces < m_torrent_file->num_pieces());
|
||||
|
||||
// if we have the last piece, we have to correct
|
||||
|
|
Loading…
Add table
Reference in a new issue