Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Fixed overflow bug by casting to int32_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Zifzaf committed Aug 19, 2020
1 parent 754b87f commit 7d24772
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sfm-common/sfm_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int16_t sfm_common_convert_flow_float(const SfmConfig* sfm_config,
}

*flow =
(flow_raw - sfm_config->flow_offset) / (float)(sfm_config->flow_scale);
((int32_t)flow_raw - (int32_t)sfm_config->flow_offset) / (float)(sfm_config->flow_scale);

return 0;
}
Expand Down

0 comments on commit 7d24772

Please sign in to comment.