Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-05-04 13:58:45 +0300
committerHans Goudey <h.goudey@me.com>2022-05-04 13:58:45 +0300
commit0f2cc50fc6b1506851b48988377d250136084cf3 (patch)
treed4ff30b6521b4c8dfe9ed26b0731faaa2148be76 /source/blender/editors/sculpt_paint/curves_sculpt_add.cc
parentcaeea212cffbf352df2d27e67690aaed4e4cd336 (diff)
Cleanup: Avoid asan overflow warning for RNG seed
Diffstat (limited to 'source/blender/editors/sculpt_paint/curves_sculpt_add.cc')
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_add.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc
index 99d725fb4cb..5fcb1d2850d 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc
@@ -183,7 +183,9 @@ struct AddOperationExecutor {
return;
}
- RandomNumberGenerator rng{(uint32_t)(PIL_check_seconds_timer() * 1000000.0f)};
+ const double time = PIL_check_seconds_timer() * 1000000.0;
+ /* Use a pointer cast to avoid overflow warnings. */
+ RandomNumberGenerator rng{*(uint32_t *)(&time)};
BKE_bvhtree_from_mesh_get(&surface_bvh_, surface_, BVHTREE_FROM_LOOPTRI, 2);
BLI_SCOPED_DEFER([&]() { free_bvhtree_from_mesh(&surface_bvh_); });