mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 01:10:51 +00:00
Fix off-by-one error in group search
This could be hit when loading raze.pk3 from the build directory while the file search path contains only one grp file
This commit is contained in:
parent
9394ebe768
commit
bea0379830
1 changed files with 3 additions and 3 deletions
|
@ -798,7 +798,7 @@ TArray<GrpEntry> GrpScan()
|
|||
int gindex = sortedGroupList.Size() - 1;
|
||||
|
||||
|
||||
while (findex > 0 && gindex > 0)
|
||||
while (findex >= 0 && gindex >= 0)
|
||||
{
|
||||
if (sortedFileList[findex]->FileLength > sortedGroupList[gindex]->size)
|
||||
{
|
||||
|
@ -815,8 +815,8 @@ TArray<GrpEntry> GrpScan()
|
|||
findex--;
|
||||
gindex--;
|
||||
// We found a matching file. Skip over all other entries of the same size so we can analyze those later as well
|
||||
while (findex > 0 && sortedFileList[findex]->FileLength == sortedFileList[findex + 1]->FileLength) findex--;
|
||||
while (gindex > 0 && sortedGroupList[gindex]->size == sortedGroupList[gindex + 1]->size) gindex--;
|
||||
while (findex >= 0 && sortedFileList[findex]->FileLength == sortedFileList[findex + 1]->FileLength) findex--;
|
||||
while (gindex >= 0 && sortedGroupList[gindex]->size == sortedGroupList[gindex + 1]->size) gindex--;
|
||||
}
|
||||
}
|
||||
sortedFileList.Delete(0, findex + 1);
|
||||
|
|
Loading…
Reference in a new issue