mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
fix index overflow for torrents with invalid meta data or empty progress
This commit is contained in:
parent
5b35981c85
commit
84759d4f20
@ -1701,6 +1701,11 @@ void TorrentHandle::manageIncompleteFiles()
|
|||||||
{
|
{
|
||||||
const bool isAppendExtensionEnabled = m_session->isAppendExtensionEnabled();
|
const bool isAppendExtensionEnabled = m_session->isAppendExtensionEnabled();
|
||||||
QVector<qreal> fp = filesProgress();
|
QVector<qreal> fp = filesProgress();
|
||||||
|
if( fp.size() != filesCount() ) {
|
||||||
|
qDebug() << "skip manageIncompleteFiles because of invalid torrent meta-data or empty file-progress";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < filesCount(); ++i) {
|
for (int i = 0; i < filesCount(); ++i) {
|
||||||
QString name = filePath(i);
|
QString name = filePath(i);
|
||||||
if (isAppendExtensionEnabled && (fileSize(i) > 0) && (fp[i] < 1)) {
|
if (isAppendExtensionEnabled && (fileSize(i) > 0) && (fp[i] < 1)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user