Fix the detection of the last dive.
It looks like the Icon HD erases old dives partially with 0xFF bytes before overwriting them with new dives. If the head of the oldest dive has been erased, the length field which is stored in the first 4 bytes is erased as well, and we can use it to detect the last dive.
This commit is contained in:
parent
9c59563d4c
commit
80f5c7025e
@ -441,7 +441,7 @@ mares_iconhd_extract_dives (device_t *abstract, const unsigned char data[], unsi
|
||||
// equals the calculated length. If both values are different,
|
||||
// something is wrong and an error is returned.
|
||||
unsigned int length = array_uint32_le (buffer + offset);
|
||||
if (length == 0)
|
||||
if (length == 0 || length == 0xFFFFFFFF)
|
||||
break;
|
||||
if (length != nbytes) {
|
||||
WARNING ("Calculated and stored size are not equal.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user