Fix #127964: Crash when baking from mesh with no faces

The issue has been introduced in aca27e5462.

Before that change the memory used for baking was cleared-alloced,
but now it relies on the default object initialization. This could
leave fields uninitialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/128181
This commit is contained in:
Sergey Sharybin
2024-09-26 15:45:02 +02:00
committed by Philipp Oeser
parent 0b33f52c8c
commit f18bc694fa
+3 -3
View File
@@ -27,7 +27,7 @@ struct PointCloud;
* Struct that stores basic information about a #BVHTree built from a mesh.
*/
struct BVHTreeFromMesh {
BVHTree *tree;
BVHTree *tree = nullptr;
/** Default callbacks to BVH nearest and ray-cast. */
BVHTree_NearestPointCallback nearest_callback;
@@ -39,10 +39,10 @@ struct BVHTreeFromMesh {
blender::Span<int> corner_verts;
blender::Span<blender::int3> corner_tris;
const MFace *face;
const MFace *face = nullptr;
/* Private data */
bool cached;
bool cached = false;
};
enum BVHCacheType {