mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
Fixed crash on attempt to load corrupted data file
Instance of FileReader is no longer destructed when header of data file is valid but complete loading of file fails Loading of truncated .zip file is the simplest test case
This commit is contained in:
parent
3f8c7239af
commit
3fa89b4e9f
6 changed files with 12 additions and 0 deletions
|
@ -351,6 +351,8 @@ FResourceFile *Check7Z(const char *filename, FileReader *file, bool quiet)
|
||||||
{
|
{
|
||||||
FResourceFile *rf = new F7ZFile(filename, file);
|
FResourceFile *rf = new F7ZFile(filename, file);
|
||||||
if (rf->Open(quiet)) return rf;
|
if (rf->Open(quiet)) return rf;
|
||||||
|
|
||||||
|
rf->Reader = NULL; // to avoid destruction of reader
|
||||||
delete rf;
|
delete rf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,8 @@ FResourceFile *CheckGRP(const char *filename, FileReader *file, bool quiet)
|
||||||
{
|
{
|
||||||
FResourceFile *rf = new FGrpFile(filename, file);
|
FResourceFile *rf = new FGrpFile(filename, file);
|
||||||
if (rf->Open(quiet)) return rf;
|
if (rf->Open(quiet)) return rf;
|
||||||
|
|
||||||
|
rf->Reader = NULL; // to avoid destruction of reader
|
||||||
delete rf;
|
delete rf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,8 @@ FResourceFile *CheckPak(const char *filename, FileReader *file, bool quiet)
|
||||||
{
|
{
|
||||||
FResourceFile *rf = new FPakFile(filename, file);
|
FResourceFile *rf = new FPakFile(filename, file);
|
||||||
if (rf->Open(quiet)) return rf;
|
if (rf->Open(quiet)) return rf;
|
||||||
|
|
||||||
|
rf->Reader = NULL; // to avoid destruction of reader
|
||||||
delete rf;
|
delete rf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,6 +260,8 @@ FResourceFile *CheckRFF(const char *filename, FileReader *file, bool quiet)
|
||||||
{
|
{
|
||||||
FResourceFile *rf = new FRFFFile(filename, file);
|
FResourceFile *rf = new FRFFFile(filename, file);
|
||||||
if (rf->Open(quiet)) return rf;
|
if (rf->Open(quiet)) return rf;
|
||||||
|
|
||||||
|
rf->Reader = NULL; // to avoid destruction of reader
|
||||||
delete rf;
|
delete rf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -651,6 +651,8 @@ FResourceFile *CheckWad(const char *filename, FileReader *file, bool quiet)
|
||||||
{
|
{
|
||||||
FResourceFile *rf = new FWadFile(filename, file);
|
FResourceFile *rf = new FWadFile(filename, file);
|
||||||
if (rf->Open(quiet)) return rf;
|
if (rf->Open(quiet)) return rf;
|
||||||
|
|
||||||
|
rf->Reader = NULL; // to avoid destruction of reader
|
||||||
delete rf;
|
delete rf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,6 +423,8 @@ FResourceFile *CheckZip(const char *filename, FileReader *file, bool quiet)
|
||||||
{
|
{
|
||||||
FResourceFile *rf = new FZipFile(filename, file);
|
FResourceFile *rf = new FZipFile(filename, file);
|
||||||
if (rf->Open(quiet)) return rf;
|
if (rf->Open(quiet)) return rf;
|
||||||
|
|
||||||
|
rf->Reader = NULL; // to avoid destruction of reader
|
||||||
delete rf;
|
delete rf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue