Skip to content

Commit d4b2e3c

Browse files
committed
doing it like this makes more sense
1 parent 091e6a9 commit d4b2e3c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

orbisFSTool/OrbisFSFile.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ uint8_t *OrbisFSFile::getDataBlock(uint32_t num){
6767
/*
6868
Stage 3 lookup
6969
*/
70-
uint64_t linkElemsPerStage2 = (uint64_t)linkElemsPerPage * (uint64_t)linkElemsPerPage;
71-
retassure(num < linkElemsPerStage2, "Trying to access out of bounds block on stage 3 lookup");
7270
uint32_t stage3Idx = num / linkElemsPerPage;
71+
retassure(stage3Idx < linkElemsPerPage, "Trying to access out of bounds block on stage 3 lookup");
7372
num %= linkElemsPerPage;
7473
fat = &fat[stage3Idx];
7574
retassure(fat->type == ORBIS_FS_CHAINLINK_TYPE_LINK, "bad dataLnk type 0x%02x in stage 3 lookup",fat->type);

0 commit comments

Comments
 (0)