mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Properly parse TRE7 section
This commit is contained in:
parent
2d0ac129ce
commit
5cd0a3a8b0
@ -180,14 +180,17 @@ bool TREFile::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// objects with extended types (TRE7)
|
// objects with extended types (TRE7)
|
||||||
if (extSize && extItemSize == 13) {
|
if (extSize && extItemSize >= 12
|
||||||
|
&& (sl.size() - (int)(extSize/extItemSize) + 1 >= 0)) {
|
||||||
quint32 polygons, lines, points;
|
quint32 polygons, lines, points;
|
||||||
quint8 kinds;
|
|
||||||
if (!seek(hdl, extOffset))
|
if (!seek(hdl, extOffset))
|
||||||
return false;
|
return false;
|
||||||
for (int i = 0; i < sl.size(); i++) {
|
|
||||||
|
for (int i = sl.size() - (extSize/extItemSize) + 1; i < sl.size(); i++) {
|
||||||
if (!(readUInt32(hdl, polygons) && readUInt32(hdl, lines)
|
if (!(readUInt32(hdl, polygons) && readUInt32(hdl, lines)
|
||||||
&& readUInt32(hdl, points) && readByte(hdl, kinds)))
|
&& readUInt32(hdl, points)))
|
||||||
|
return false;
|
||||||
|
if (!seek(hdl, hdl.pos + extItemSize - 12))
|
||||||
return false;
|
return false;
|
||||||
if (i && sl.at(i-1))
|
if (i && sl.at(i-1))
|
||||||
sl.at(i-1)->setExtEnds(polygons, lines, points);
|
sl.at(i-1)->setExtEnds(polygons, lines, points);
|
||||||
|
Loading…
Reference in New Issue
Block a user