diff options
author | Christian Riggenbach <criggenbach@magahugu.ch> | 2022-11-21 18:35:13 +0100 |
---|---|---|
committer | Christian Riggenbach <criggenbach@magahugu.ch> | 2022-12-15 08:23:48 +0100 |
commit | 23a0432451cab1e434df0efda391dbeb4790e9f0 (patch) | |
tree | 922152ab50e1130a6b418603883afa0732d1eb9a /src/core/jobs | |
parent | 56267ef68be8fa4a38ce570c8f1ad378457b30fb (diff) |
check bounding volumes for validity in concurrent reduction step
The multithreaded job doesn't check the visited bounding volumes for
validity before adding them to the list to process further. This leads
to crashes, namely nullptr-dereferences.
Fixes: QTBUG-108405
Pick-to: 6.4
Change-Id: I16a7c008c7ac4f04be40bdbba05d8c745c1c825e
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/jobs')
-rw-r--r-- | src/core/jobs/calcboundingvolumejob.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/jobs/calcboundingvolumejob.cpp b/src/core/jobs/calcboundingvolumejob.cpp index d5ea36582..5fab373b3 100644 --- a/src/core/jobs/calcboundingvolumejob.cpp +++ b/src/core/jobs/calcboundingvolumejob.cpp @@ -140,9 +140,11 @@ struct ReduceUpdateBoundFunctor { void operator ()(std::vector<BoundingVolumeComputeResult> &result, const std::vector<BoundingVolumeComputeResult> &values) { - result.insert(result.end(), - std::make_move_iterator(values.begin()), - std::make_move_iterator(values.end())); + for (const auto &value : values) { + if (value.valid()) { + result.push_back(value); + } + } } }; |