1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

ENC parser optimizations

This commit is contained in:
Martin Tůma 2022-11-04 09:53:37 +01:00
parent 37f9d97a9e
commit cc2703e71d

View File

@ -449,11 +449,10 @@ bool MapData::processRecord(const ISO8211::Record &record)
const QByteArray &ba = f.tag(); const QByteArray &ba = f.tag();
if (ba == "VRID") { if (ba == "VRID") {
int RCNM; if (f.data().at(0).size() < 2)
uint RCID;
if (!(f.subfield("RCNM", &RCNM) && f.subfield("RCID", &RCID)))
return false; return false;
int RCNM = f.data().at(0).at(0).toInt();
uint RCID = f.data().at(0).at(1).toUInt();
switch (RCNM) { switch (RCNM) {
case RCNM_VI: case RCNM_VI:
@ -582,7 +581,7 @@ void MapData::load()
const ISO8211::Record &r = _fe.at(i); const ISO8211::Record &r = _fe.at(i);
const ISO8211::Field &f = r.at(1); const ISO8211::Field &f = r.at(1);
if (f.data().at(0).size() != 7) if (f.data().at(0).size() < 5)
continue; continue;
PRIM = f.data().at(0).at(2).toUInt(); PRIM = f.data().at(0).at(2).toUInt();
OBJL = f.data().at(0).at(4).toUInt(); OBJL = f.data().at(0).at(4).toUInt();