VolumeVerifier: Check whether invalid blocks are unused

This commit is contained in:
JosJuice
2019-03-30 16:20:45 +01:00
parent eced9d7c7e
commit a469fb3150
5 changed files with 55 additions and 26 deletions

View File

@ -27,6 +27,7 @@
#include "DiscIO/Blob.h"
#include "DiscIO/CompressedBlob.h"
#include "DiscIO/DiscScrubber.h"
#include "DiscIO/Volume.h"
namespace DiscIO
{
@ -181,9 +182,11 @@ bool CompressFileToBlob(const std::string& infile_path, const std::string& outfi
}
DiscScrubber disc_scrubber;
std::unique_ptr<Volume> volume;
if (sub_type == 1)
{
if (!disc_scrubber.SetupScrub(infile_path, block_size))
volume = CreateVolumeFromFilename(infile_path);
if (!volume || !disc_scrubber.SetupScrub(volume.get(), block_size))
{
PanicAlertT("\"%s\" failed to be scrubbed. Probably the image is corrupt.",
infile_path.c_str());