pbrt-parser icon indicating copy to clipboard operation
pbrt-parser copied to clipboard

Semantic parser seg faults if the input file contains an unsupported shape type

Open vilya opened this issue 3 years ago • 0 comments

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.

vilya avatar Aug 19 '20 13:08 vilya