From c506be93f94eb40d7b6802685074c496d546c202 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 22 Aug 2016 20:58:37 +0200 Subject: [PATCH] Fix the decoding of the maximum depth. Several devices (e.g. Oceanic Geo, Oceanic Veo 2.0 and Tusa Zen) report a maximum depth that is clearly too large. The problem is easily fixed by ignoring the higher bits. The exact bit mask is an educated guess. A 12 bit value is plausible because it's also used for the sample depths. --- src/oceanic_atom2_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 8dbab5f..143921e 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -498,7 +498,7 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns parser->model == MUNDIAL3) *((double *) value) = array_uint16_le (data + 4) / 16.0 * FEET; else - *((double *) value) = array_uint16_le (data + parser->footer + 4) / 16.0 * FEET; + *((double *) value) = (array_uint16_le (data + parser->footer + 4) & 0x0FFF) / 16.0 * FEET; break; case DC_FIELD_GASMIX_COUNT: *((unsigned int *) value) = parser->ngasmixes;