From cebf4089cc6788a257fdceef33ce5f9ac064655b Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 25 Aug 2020 15:12:12 +0200 Subject: [PATCH] Verify the oxygen and helium percentage The oxygen and helium percentage in the gas change event should correspond to the percentages indicated in the dive header. --- src/suunto_d9_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/suunto_d9_parser.c b/src/suunto_d9_parser.c index 11b99e9..f735a7e 100644 --- a/src/suunto_d9_parser.c +++ b/src/suunto_d9_parser.c @@ -757,7 +757,7 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca if ((type & 0x80) == 0) { idx += parser->nccr; } - if (idx >= parser->ngasmixes) { + if (idx >= parser->ngasmixes || o2 != parser->oxygen[idx] || he != parser->helium[idx]) { ERROR (abstract->context, "Invalid gas mix."); return DC_STATUS_DATAFORMAT; }