Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2022-05-25 14:19:26 +0300
committerYimingWu <xp8110@outlook.com>2022-05-25 14:23:23 +0300
commit53f7c220227ad4041dd9587c0a4091c9408e1625 (patch)
tree352a3c327f4fc77a47181fcc56627595377d9a0e /source/blender/gpencil_modifiers
parent332d87375d747995748121d7931c0a8e045fe936 (diff)
Fix T98359: Handle object that has no feature lines.
In case of line art "occlusion only" or contour not enabled, it's possible for an object to not produce any feature lines. This patch checks that to prevent freeing a NULL pointer.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index fe1bbc3fc23..2d3e37e5723 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1753,6 +1753,11 @@ static void lineart_finalize_object_edge_array_reserve(LineartPendingEdges *pe,
static void lineart_finalize_object_edge_array(LineartPendingEdges *pe, LineartObjectInfo *obi)
{
+ /* In case of line art "occlusion only" or contour not enabled, it's possible for an object to
+ * not produce any feature lines. */
+ if (!obi->pending_edges.array) {
+ return;
+ }
memcpy(&pe->array[pe->next],
obi->pending_edges.array,
sizeof(LineartEdge *) * obi->pending_edges.next);