mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Don't access uninitialized deco_structure
Coverty found that in the export functions, we initialize the planner deco state with NULL and then possibly later access its content. This makes sure, we don't do that. Let's see if this makes Coverty happy or I missed somehting else. Fixes CID 350736 Fixes CID 350735 Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
1a2c42cebc
commit
28db9ede41
1 changed files with 2 additions and 1 deletions
|
@ -1034,8 +1034,9 @@ void calculate_deco_information(struct deco_state *ds, const struct deco_state *
|
|||
bool first_iteration = true;
|
||||
int prev_deco_time = 10000000, time_deep_ceiling = 0;
|
||||
|
||||
if (!in_planner()) {
|
||||
if (!in_planner() || !planner_ds) {
|
||||
ds->deco_time = 0;
|
||||
ds->first_ceiling_pressure.mbar = 0;
|
||||
} else {
|
||||
ds->deco_time = planner_ds->deco_time;
|
||||
ds->first_ceiling_pressure = planner_ds->first_ceiling_pressure;
|
||||
|
|
Loading…
Add table
Reference in a new issue