mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- fixed: FResourceFile::FilterLumps must use a proper copy of the filename to pass to LumpNameSetup instead of a pointer to the file name's stringbuffer, because that function will overwrite the variable it is taken from.
This commit is contained in:
parent
25e19ab471
commit
1fddd1859e
1 changed files with 2 additions and 3 deletions
|
@ -98,8 +98,7 @@ void FResourceLump::LumpNameSetup(const char *iname)
|
|||
base = base.Left(base.LastIndexOf('.'));
|
||||
uppercopy(Name, base);
|
||||
Name[8] = 0;
|
||||
FString temp = iname; // Note: iname can point to inside FullName's string buffer so we cannot do the assignment directly.
|
||||
FullName = temp;
|
||||
FullName = iname;
|
||||
|
||||
// Map some directories to WAD namespaces.
|
||||
// Note that some of these namespaces don't exist in WADS.
|
||||
|
@ -382,7 +381,7 @@ int FResourceFile::FilterLumps(FString filtername, void *lumps, size_t lumpsize,
|
|||
{
|
||||
FResourceLump *lump = (FResourceLump *)lump_p;
|
||||
assert(lump->FullName.CompareNoCase(filter, (int)filter.Len()) == 0);
|
||||
lump->LumpNameSetup(&lump->FullName[filter.Len()]);
|
||||
lump->LumpNameSetup(lump->FullName.Mid(filter.Len()));
|
||||
}
|
||||
|
||||
// Move filtered lumps to the end of the lump list.
|
||||
|
|
Loading…
Reference in a new issue