Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash if "sampler2D" tag is specified without "instance_image" #630

Open
malcolmst opened this issue Jan 15, 2020 · 0 comments
Open

Crash if "sampler2D" tag is specified without "instance_image" #630

malcolmst opened this issue Jan 15, 2020 · 0 comments

Comments

@malcolmst
Copy link

malcolmst commented Jan 15, 2020

While dealing with an unrelated issue (wrong schema version) I came across a crash that occurs when the <sampler2D> tag is specified without an enclosed <instance_image>.

The bug appears to be in LibraryEffectsLoader::fillSamplerArray. If validSurface is false, samplerArray[samplerIndex] is never assigned, and contains uninitialized memory. This is referenced later on from DocumentImporter::writeEffect which is where the crash occurs. Probably one way to avoid this would be to just treat an invalid surface as a fatal error, or some other fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant