Fix FitRideFile for header change

The header size in FitRideFile has increased from
12 to 14 bytes, but the new field is at the end of
the header, not in the middle.

Additionally, there is a new global record (79) which
we now silently ignore.
This commit is contained in:
Mark Liversedge
2011-08-27 23:50:32 +01:00
parent ad9a76a172
commit 524ab81a08

View File

@@ -526,6 +526,7 @@ struct FitFileReaderState
case 72: /* undocumented - new for garmin 800*/
case 34: /* activity */
case 49: /* file creator */
case 79: /* unknown */
break;
default:
unknown_global_msg_nums.insert(def.global_msg_num);
@@ -555,7 +556,6 @@ struct FitFileReaderState
// if the header size is 14 we have profile minor then profile major
// version. We still don't do anything with this information
int profile_version = read_uint16(false); // always littleEndian
if (header_size == 14) profile_version = read_uint16(false);
(void) profile_version; // not sure what to do with this
int data_size = read_uint32(false); // always littleEndian
@@ -571,6 +571,10 @@ struct FitFileReaderState
delete rideFile;
return NULL;
}
// read the rest of the header
if (header_size == 14) read_uint16(false);
int bytes_read = 0;
bool stop = false;
try {