Fix verifying on images that are not dividable by block size

This commit is contained in:
Floris Bos 2020-03-06 12:00:46 +01:00
parent 75feb3e73d
commit a367ed0683

View file

@ -610,7 +610,7 @@ bool DownloadThread::_verify()
while (_verifyEnabled && _lastVerifyNow < _verifyTotal && !_cancelled)
{
qint64 lenRead = _file.read(verifyBuf, IMAGEWRITER_VERIFY_BLOCKSIZE);
qint64 lenRead = _file.read(verifyBuf, qMin((qint64) IMAGEWRITER_VERIFY_BLOCKSIZE, (qint64) (_verifyTotal-_lastVerifyNow) ));
if (lenRead == -1)
{
DownloadThread::_onDownloadError(tr("Error reading from storage.\n"