diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index 5f571bb..addc295 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -363,6 +363,9 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi unsigned int trimix = 0; if (parser->model == GALILEOTRIMIX) { + if (size < 44) + return DC_STATUS_DATAFORMAT; + if (data[43] & 0x80) { header = 0xB1; trimix = 1; @@ -473,6 +476,9 @@ uwatec_smart_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t unsigned int trimix = 0; if (parser->model == GALILEOTRIMIX) { + if (size < 44) + return DC_STATUS_DATAFORMAT; + if (data[43] & 0x80) { header = 0xB1; trimix = 1;