Skip to content

Commit 3581f8e

Browse files
jefdriesenmikeller
authored andcommitted
Ignore invalid GPS locations
Apparantly the GPS location fields can also contain the magic value 0xFFFFFFFF (or -1 as signed integer) to indicate the absence of a GPS location. Reported-by: Greg McLaughlin <[email protected]>
1 parent 074b669 commit 3581f8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shearwater_predator_parser.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,8 @@ shearwater_predator_parser_get_field (dc_parser_t *abstract, dc_field_type_t typ
11021102
return DC_STATUS_UNSUPPORTED;
11031103
latitude = (signed int) array_uint32_be (data + parser->opening[9] + 21);
11041104
longitude = (signed int) array_uint32_be (data + parser->opening[9] + 25);
1105-
if (latitude == 0 && longitude == 0)
1105+
if ((latitude == 0 && longitude == 0) ||
1106+
(latitude == -1 && longitude == -1))
11061107
return DC_STATUS_UNSUPPORTED;
11071108
location->latitude = latitude / 100000.0;
11081109
location->longitude = longitude / 100000.0;

0 commit comments

Comments
 (0)