From c1c0473a7efb5dc6455401799e3f3e8282aa31df Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Fri, 12 Aug 2022 17:52:15 +0200 Subject: Fix out of bounds read in LineArt if there are only interestion edges In this case the array allocation would allocate an array of size zero. This would then later lead to out of bounds memory reads. Now the code will skip zero length allocations. --- source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/gpencil_modifiers') diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index 9970e4d5ac1..a6b9f1420f1 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -1799,7 +1799,7 @@ static void lineart_add_edge_to_array_thread(LineartObjectInfo *obi, LineartEdge * #pe. */ void lineart_finalize_object_edge_array_reserve(LineartPendingEdges *pe, int count) { - if (pe->max || pe->array) { + if (pe->max || pe->array || count == 0) { return; } -- cgit v1.2.3