pbrt-parser
pbrt-parser copied to clipboard
Semantic parser seg faults if the input file contains an unsupported shape type
Hi,
There is a seg fault in SemanticParser::findOrCreateShape
when the input file contains an unsupported shape type.
SemanticParser::emitShape
returns a null pointer for any shape type that isn't supported yet. SemanticParser::findOrCreateShape
calls emitShape
then tries to set the reverseOrientation property on the returned pointer without checking whether it was null. That's where we get a seg fault if the shape type was not supported.
This means the semantic parser can't load some of the example scenes from https://pbrt.org/scenes-v3.html. For example the Contemporary Bathroom scene: this contains some loopsubdiv
shapes, which make the parser crash.
Hope that helps.