1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Only read the node offset when it is actually present

This commit is contained in:
Martin Tůma 2022-04-08 00:23:45 +02:00
parent e3582cc5cf
commit 8bc91c760a

View File

@ -170,12 +170,12 @@ bool NODFile::linkInfo(Handle &hdl, const BlockInfo &blockInfo, quint32 linkId,
if (!bs.read(s1 - s2, linkInfo.linkOffset)) if (!bs.read(s1 - s2, linkInfo.linkOffset))
return false; return false;
linkInfo.linkOffset += blockInfo.hdr.linkInfoOffsetBase; linkInfo.linkOffset += blockInfo.hdr.linkInfoOffsetBase;
}
if (!bs.read(s2, linkInfo.nodeOffset)) if (!bs.read(s2, linkInfo.nodeOffset))
return false; return false;
linkInfo.nodeOffset = (blockInfo.offset - linkInfo.nodeOffset) linkInfo.nodeOffset = (blockInfo.offset - linkInfo.nodeOffset)
>> _nodeShift; >> _nodeShift;
}
return true; return true;
} }