mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-17 16:20:48 +01:00
Fixed error handling
This commit is contained in:
parent
c97aa9c25d
commit
4b66aaa78b
@ -87,8 +87,10 @@ bool FITParser::parseDefinitionMessage(quint8 header)
|
||||
quint8 i;
|
||||
|
||||
|
||||
if (def->fields)
|
||||
if (def->fields) {
|
||||
delete[] def->fields;
|
||||
def->fields = 0;
|
||||
}
|
||||
|
||||
// reserved/unused
|
||||
if (!readValue(i))
|
||||
@ -110,10 +112,6 @@ bool FITParser::parseDefinitionMessage(quint8 header)
|
||||
// number of records
|
||||
if (!readValue(def->num_fields))
|
||||
return false;
|
||||
if (def->num_fields == 0) {
|
||||
def->fields = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
// definition records
|
||||
def->fields = new Field[def->num_fields];
|
||||
|
Loading…
x
Reference in New Issue
Block a user