mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-31 03:50:20 -07:00
Merge pull request #6848 from evsh/fix-piecebar-crash
Fix crash in download piece bar
This commit is contained in:
commit
ae5932a573
1 changed files with 2 additions and 1 deletions
|
@ -50,7 +50,8 @@ namespace
|
|||
{
|
||||
public:
|
||||
PieceIndexToImagePos(const BitTorrent::TorrentInfo &torrentInfo, const QImage &image)
|
||||
: m_bytesPerPixel {image.width() > 0 ? torrentInfo.totalSize() / image.width() : -1}
|
||||
: m_bytesPerPixel {(image.width() > 0 && torrentInfo.totalSize() >= image.width())
|
||||
? torrentInfo.totalSize() / image.width() : -1}
|
||||
, m_torrentInfo {torrentInfo}
|
||||
{
|
||||
if ((m_bytesPerPixel > 0) && (m_bytesPerPixel < 10))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue