diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2022-08-12 18:52:15 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2022-08-12 18:56:36 +0300 |
commit | c1c0473a7efb5dc6455401799e3f3e8282aa31df (patch) | |
tree | 7c524b6b608225cf71dc7197d771febf7721a359 /source | |
parent | 82fe475f06b32266d4c7374711b0a2d1498f1488 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |