forked from premiere/premiere-libtorrent
fix regression in torrent size check
This commit is contained in:
parent
33b03e1f8e
commit
c0d76a5304
|
@ -1013,7 +1013,8 @@ namespace {
|
|||
// we want this division to round upwards, that's why we have the
|
||||
// extra addition
|
||||
|
||||
if (files.total_size() >= std::numeric_limits<int>::max()
|
||||
if (files.total_size() >=
|
||||
(std::numeric_limits<std::int64_t>::max() / files.piece_length())
|
||||
- files.piece_length())
|
||||
{
|
||||
ec = errors::too_many_pieces_in_torrent;
|
||||
|
|
|
@ -126,6 +126,7 @@ static test_torrent_t test_torrents[] =
|
|||
{ "unordered.torrent" },
|
||||
{ "symlink_zero_size.torrent" },
|
||||
{ "pad_file_no_path.torrent" },
|
||||
{ "large.torrent" },
|
||||
};
|
||||
|
||||
struct test_failing_torrent_t
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue