1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +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();
if (ba == "VRID") {
int RCNM;
uint RCID;
if (!(f.subfield("RCNM", &RCNM) && f.subfield("RCID", &RCID)))
if (f.data().at(0).size() < 2)
return false;
int RCNM = f.data().at(0).at(0).toInt();
uint RCID = f.data().at(0).at(1).toUInt();
switch (RCNM) {
case RCNM_VI:
@ -582,7 +581,7 @@ void MapData::load()
const ISO8211::Record &r = _fe.at(i);
const ISO8211::Field &f = r.at(1);
if (f.data().at(0).size() != 7)
if (f.data().at(0).size() < 5)
continue;
PRIM = f.data().at(0).at(2).toUInt();
OBJL = f.data().at(0).at(4).toUInt();