Prevent empty sub-paths from causing segfaults in LPEPowerStroke.

An empty sub-path ("M x, y Z") causes trouble when trying to count the number of curves in the sub-path when the code attempts to check if the path's closing curve (line) is degenerate (degenerate closing paths are not counted). The function Geom::Path::back_closed() can't return a valid curve. To avoid a segfault, using Geom::Path::back_default() might be better but it would return an empty (degenerate) curve. Better to just ignore empty sub-paths.

This fixes the code in two place: in the LPEPowerStroke::doEffect_path function as well as more generically in the function count_path_curves() (geom.cpp). For good measure, it also adds checks to count_path_nodes() and count_path_degenerations().

Fixes #5263 (closed).

Merge request reports

Loading