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

Fixed broken subdivs parsing

This commit is contained in:
Martin Tůma 2022-03-20 16:43:18 +01:00
parent 7c838331c2
commit 78703f3651

View File

@ -235,6 +235,9 @@ bool TREFile::load(int idx)
totalSubdivs += _levels.at(i).subdivs; totalSubdivs += _levels.at(i).subdivs;
quint32 extendedSubdivs = _extended.size / _extended.itemSize; quint32 extendedSubdivs = _extended.size / _extended.itemSize;
quint32 diff = totalSubdivs - extendedSubdivs + 1; quint32 diff = totalSubdivs - extendedSubdivs + 1;
if (skip < diff)
return true;
if (!seek(hdl, _extended.offset + (skip - diff) * _extended.itemSize)) if (!seek(hdl, _extended.offset + (skip - diff) * _extended.itemSize))
goto error; goto error;