Fix: GPv3: Crash rendering cyclic strokes with single point
Creating the batch cache for rendering crashes when there is a stroke with one point that is set to cyclic. There was a missing check for the number of points because we're accessing the curve lengths, which needs at least 2 points to be populated.
This commit is contained in:
@@ -633,7 +633,7 @@ static void grease_pencil_geom_batch_ensure(Object &object,
|
||||
cols_slice[idx]);
|
||||
}
|
||||
|
||||
if (is_cyclic) {
|
||||
if (is_cyclic && points.size() > 1) {
|
||||
const int idx = points.size() + 1;
|
||||
const float u_stroke = u_scale * lengths[points.size() - 1] + u_translation;
|
||||
populate_point(verts_range,
|
||||
|
||||
Reference in New Issue
Block a user