GPencil: Avoid LineArt modifier uses negative material index

In some situations the material index could be negative, and this is wrong.
This commit is contained in:
Antonio Vazquez 2021-03-31 16:17:31 +02:00
parent d55d4fee30
commit 23bd6cff81
Notes: blender-bot 2023-02-14 05:36:11 +01:00
Referenced by issue #86981, Grease Pencil and Line Art crashes
1 changed files with 1 additions and 1 deletions

View File

@ -3858,7 +3858,7 @@ static void lineart_gpencil_generate(LineartRenderBuffer *rb,
BKE_gpencil_stroke_add_points(gps, stroke_data, count, mat);
BKE_gpencil_dvert_ensure(gps);
gps->mat_nr = material_nr;
gps->mat_nr = max_ii(material_nr, 0);
MEM_freeN(stroke_data);