mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
Added simple check for unsupported compression method in .7z files
This commit is contained in:
parent
3fa89b4e9f
commit
6b26b710b8
1 changed files with 15 additions and 0 deletions
|
@ -293,6 +293,21 @@ bool F7ZFile::Open(bool quiet)
|
|||
}
|
||||
// Resize the lump record array to its actual size
|
||||
NumLumps -= skipped;
|
||||
|
||||
if (NumLumps > 0)
|
||||
{
|
||||
// Quick check for unsupported compression method
|
||||
|
||||
TArray<char> temp;
|
||||
temp.Resize(Lumps[0].LumpSize);
|
||||
|
||||
if (SZ_OK != Archive->Extract(Lumps[0].Position, &temp[0]))
|
||||
{
|
||||
if (!quiet) Printf("\n%s: unsupported 7z/LZMA file!\n", Filename);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!quiet) Printf(", %d lumps\n", NumLumps);
|
||||
|
||||
// Entries in archives are sorted alphabetically
|
||||
|
|
Loading…
Reference in a new issue