diff options
author | Christian Riggenbach <criggenbach@magahugu.ch> | 2022-11-21 18:35:13 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-12-15 10:01:14 +0000 |
commit | f9657e06d0320b0823237d627b468491b7127bf0 (patch) | |
tree | 2a0fc2a85ecf5f72106d57b51e360ef06fc9ce5e | |
parent | 1cd5ed5468259d59a91055b7d0a21571f29d650e (diff) | |
download | qt3d-f9657e06d0320b0823237d627b468491b7127bf0.tar.gz |
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
Change-Id: I16a7c008c7ac4f04be40bdbba05d8c745c1c825e
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
(cherry picked from commit 23a0432451cab1e434df0efda391dbeb4790e9f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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); + } + } } }; |