Browse Source

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

This should fix crashes. Issue #4597
adaptive-webui-19844
Eugene Shalygin 9 years ago
parent
commit
8baa144933
  1. 2
      src/base/bittorrent/torrentinfo.cpp

2
src/base/bittorrent/torrentinfo.cpp

@ -217,7 +217,7 @@ QStringList TorrentInfo::filesForPiece(int pieceIndex) const
return QStringList(); return QStringList();
std::vector<libtorrent::file_slice> files( 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; QStringList res;
for (const libtorrent::file_slice& s: files) { for (const libtorrent::file_slice& s: files) {
res.append(filePath(s.file_index)); res.append(filePath(s.file_index));

Loading…
Cancel
Save