pcl
pcl copied to clipboard
Add rgb field if it doesn't exist when trying to add alpha value
Added hasField and findField. Add rgb field, if not there and alpha should be added.
Should fix: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50652
Alternatively we should show an error that there is no rgb field to convert to rgba?
I am wondering: does it make sense to add the new functions hasField and findField? There is already getFieldIndex which has pretty much the same purpose (documentation of the getFieldIndex functions could be improved though). And I currently don't see where hasField and findField could be useful outside of the one place in PLYReader.
Regarding the issue with rgb/alpha: maybe we should at least print a warning if there is no rgb yet? Would this additional check deal with property orders like x y z alpha red green blue?
I changed it to use the method you mentioned - thanks :+1:
And I changed to just emit an error as well as returning an empty callback, as it seems to be an ill-defined header anyways, for a PLY file. At least a usable ply file with respect to PCL.