mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Avoid crash if decode produced no data.
This commit is contained in:
23
lib/image.cc
23
lib/image.cc
@@ -59,15 +59,20 @@ void writeSectorsToFile(const std::vector<std::unique_ptr<Sector>>& sectors, con
|
||||
}
|
||||
}
|
||||
int goodSectors = totalSectors - missingSectors - badSectors;
|
||||
std::cout << "Good sectors: " << goodSectors << "/" << totalSectors
|
||||
<< " (" << (100*goodSectors/totalSectors) << "%)"
|
||||
<< std::endl;
|
||||
std::cout << "Missing sectors: " << missingSectors << "/" << totalSectors
|
||||
<< " (" << (100*missingSectors/totalSectors) << "%)"
|
||||
<< std::endl;
|
||||
std::cout << "Bad sectors: " << badSectors << "/" << totalSectors
|
||||
<< " (" << (100*badSectors/totalSectors) << "%)"
|
||||
<< std::endl;
|
||||
if (totalSectors == 0)
|
||||
std::cout << "No sectors in output; skipping analysis" << std::endl;
|
||||
else
|
||||
{
|
||||
std::cout << "Good sectors: " << goodSectors << "/" << totalSectors
|
||||
<< " (" << (100*goodSectors/totalSectors) << "%)"
|
||||
<< std::endl;
|
||||
std::cout << "Missing sectors: " << missingSectors << "/" << totalSectors
|
||||
<< " (" << (100*missingSectors/totalSectors) << "%)"
|
||||
<< std::endl;
|
||||
std::cout << "Bad sectors: " << badSectors << "/" << totalSectors
|
||||
<< " (" << (100*badSectors/totalSectors) << "%)"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
size_t sideSize = sectorCount * sectorSize;
|
||||
size_t trackSize = sideSize * sideCount;
|
||||
|
||||
Reference in New Issue
Block a user