From b54d629401d5bee83ee4bbd5f3e40e01e0f9bdea Mon Sep 17 00:00:00 2001 From: YimingWu Date: Fri, 4 Apr 2025 12:04:20 +0200 Subject: [PATCH] Fix: Line Art: Prevent loading empty meshes In `lineart_geometry_check_visible` it could recieve a valid mesh without any vertices, this causes `bounds` below to be invalid. Now return early if encountered such situation. Pull Request: https://projects.blender.org/blender/blender/pulls/136819 --- source/blender/modifiers/intern/lineart/lineart_cpu.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/modifiers/intern/lineart/lineart_cpu.cc b/source/blender/modifiers/intern/lineart/lineart_cpu.cc index 483e4d04bde..3bffce14b7f 100644 --- a/source/blender/modifiers/intern/lineart/lineart_cpu.cc +++ b/source/blender/modifiers/intern/lineart/lineart_cpu.cc @@ -2430,9 +2430,12 @@ static bool lineart_geometry_check_visible(double model_view_proj[4][4], if (!use_mesh) { return false; } - const Bounds bounds = *use_mesh->bounds_min_max(); + const std::optional> bounds = use_mesh->bounds_min_max(); + if (!bounds.has_value()) { + return false; + } BoundBox bb; - BKE_boundbox_init_from_minmax(&bb, bounds.min, bounds.max); + BKE_boundbox_init_from_minmax(&bb, bounds.value().min, bounds.value().max); double co[8][4]; double tmp[3];