From a82fa3e39dff564828819a65f5a0e78dff2ff6b1 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Fri, 24 May 2024 19:47:07 +0800 Subject: [PATCH] fill_aligned_z: fix uninitialized atomic_int64_t The behavior of atomic_int64_t's default constructor will leave it to an uninitialized state (accessing it will be undefined behavior). Use 0 to explicitly initialize it because it will be soon compared and exchanged. Signed-off-by: Icenowy Zheng --- src/libslic3r/PrintObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 7db8108f277..18d68c51f4a 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -551,7 +551,7 @@ namespace Slic3r { void PrintObject::_compute_max_sparse_spacing() { m_max_sparse_spacing = 0; - std::atomic_int64_t max_sparse_spacing; + std::atomic_int64_t max_sparse_spacing(0); tbb::parallel_for( tbb::blocked_range(0, m_layers.size()), [this, &max_sparse_spacing](const tbb::blocked_range& range) {