Merge pull request #8303 from JosJuice/volumeverifier-very-small

Fix problems with running VolumeVerifier on very small disc images
This commit is contained in:
Connor McLaughlin 2019-08-09 22:16:33 +10:00 committed by GitHub
commit e87a3f91a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,8 @@ bool DiscScrubber::SetupScrub(const Volume* disc, int block_size)
m_file_size = m_disc->GetSize(); m_file_size = m_disc->GetSize();
const size_t num_clusters = static_cast<size_t>(m_file_size / CLUSTER_SIZE); // Round up when diving by CLUSTER_SIZE, otherwise MarkAsUsed might write out of bounds
const size_t num_clusters = static_cast<size_t>((m_file_size + CLUSTER_SIZE - 1) / CLUSTER_SIZE);
// Warn if not DVD5 or DVD9 size // Warn if not DVD5 or DVD9 size
if (num_clusters != 0x23048 && num_clusters != 0x46090) if (num_clusters != 0x23048 && num_clusters != 0x46090)

View File

@ -117,7 +117,7 @@ void VerifyWidget::Verify()
verifier.Finish(); verifier.Finish();
DiscIO::VolumeVerifier::Result result = verifier.GetResult(); DiscIO::VolumeVerifier::Result result = verifier.GetResult();
progress->setValue(verifier.GetBytesProcessed() / DIVISOR); progress->reset();
m_summary_text->setText(QString::fromStdString(result.summary_text)); m_summary_text->setText(QString::fromStdString(result.summary_text));