1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Use correct piece size while calling torrent_info::map_block()

This should fix crashes. Issue #4597
This commit is contained in:
Eugene Shalygin 2016-02-27 21:05:43 +01:00
parent b24bdcb8d9
commit 8baa144933

View File

@ -217,7 +217,7 @@ QStringList TorrentInfo::filesForPiece(int pieceIndex) const
return QStringList();
std::vector<libtorrent::file_slice> files(
nativeInfo()->map_block(pieceIndex, 0, nativeInfo()->piece_length()));
nativeInfo()->map_block(pieceIndex, 0, nativeInfo()->piece_size(pieceIndex)));
QStringList res;
for (const libtorrent::file_slice& s: files) {
res.append(filePath(s.file_index));