From 8baa1449336dea55d35d5127aabeefd85355e897 Mon Sep 17 00:00:00 2001 From: Eugene Shalygin Date: Sat, 27 Feb 2016 21:05:43 +0100 Subject: [PATCH] Use correct piece size while calling torrent_info::map_block() This should fix crashes. Issue #4597 --- src/base/bittorrent/torrentinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentinfo.cpp b/src/base/bittorrent/torrentinfo.cpp index 95a5b5add..d9c4d3791 100644 --- a/src/base/bittorrent/torrentinfo.cpp +++ b/src/base/bittorrent/torrentinfo.cpp @@ -217,7 +217,7 @@ QStringList TorrentInfo::filesForPiece(int pieceIndex) const return QStringList(); std::vector 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));