Browse Source

Fix loading corrupted .fastresume file

adaptive-webui-19844
Vladimir Golovnev (Glassez) 9 years ago
parent
commit
3a2bd3c9b1
  1. 2
      src/base/bittorrent/session.cpp

2
src/base/bittorrent/session.cpp

@ -2340,7 +2340,7 @@ bool loadTorrentResumeData(const QByteArray &data, AddTorrentData &out, MagnetUr
libt::lazy_entry fast; libt::lazy_entry fast;
libt::error_code ec; libt::error_code ec;
libt::lazy_bdecode(data.constData(), data.constData() + data.size(), fast, ec); libt::lazy_bdecode(data.constData(), data.constData() + data.size(), fast, ec);
if ((fast.type() != libt::lazy_entry::dict_t) && !ec) return false; if (ec || (fast.type() != libt::lazy_entry::dict_t)) return false;
out.savePath = Utils::Fs::fromNativePath(Utils::String::fromStdString(fast.dict_find_string_value("qBt-savePath"))); out.savePath = Utils::Fs::fromNativePath(Utils::String::fromStdString(fast.dict_find_string_value("qBt-savePath")));
out.ratioLimit = Utils::String::fromStdString(fast.dict_find_string_value("qBt-ratioLimit")).toDouble(); out.ratioLimit = Utils::String::fromStdString(fast.dict_find_string_value("qBt-ratioLimit")).toDouble();

Loading…
Cancel
Save