[Bf-blender-cvs] [53f7c220227] master: Fix T98359: Handle object that has no feature lines.

YimingWu noreply at git.blender.org
Wed May 25 13:36:56 CEST 2022


Commit: 53f7c220227ad4041dd9587c0a4091c9408e1625
Author: YimingWu
Date:   Wed May 25 19:19:26 2022 +0800
Branches: master
https://developer.blender.org/rB53f7c220227ad4041dd9587c0a4091c9408e1625

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.

===================================================================

M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list