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.
This commit is contained in:
YimingWu
2022-05-25 19:19:26 +08:00
parent 332d87375d
commit 53f7c22022

View File

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