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.
This commit is contained in:
Sebastian Parborg 2022-08-12 17:52:15 +02:00
parent 82fe475f06
commit c1c0473a7e
1 changed files with 1 additions and 1 deletions

View File

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