You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using OrganizedMultiPlaneSegmentation, if the user does not specify both an input cloud and normals they will experience a segfault. This is because those pointers are dereferenced on line 95, without first checking if the pointers are valid:
I suggest adding additional guard clauses before line 95 to check for valid inputs.
if ( !input_ )
{
PCL_ERROR ("[pcl::%s::segment] You must provide a valid input cloud.\n",
getClassName ().c_str ());
return;
}
if ( !normals_ )
{
PCL_ERROR ("[pcl::%s::segment] You must provide a valid input normals.\n",
getClassName ().c_str ());
return;
}
Alternatively it could throw an exception... but I figured it's better to match the other error handling inside this file.
I'm happy to open a PR if one or the other approach sounds good
The text was updated successfully, but these errors were encountered:
kunaltyagi
changed the title
[custom] Improve error handling in OrganizedMultiPlaneSegmentation::segment
[segmentation] Improve error handling in OrganizedMultiPlaneSegmentation::segment
Apr 3, 2020
When using OrganizedMultiPlaneSegmentation, if the user does not specify both an input cloud and normals they will experience a segfault. This is because those pointers are dereferenced on line 95, without first checking if the pointers are valid:
I suggest adding additional guard clauses before line 95 to check for valid inputs.
Alternatively it could throw an exception... but I figured it's better to match the other error handling inside this file.
I'm happy to open a PR if one or the other approach sounds good
The text was updated successfully, but these errors were encountered: