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

Bugfix/import crashes #4226

Merged
merged 3 commits into from
Dec 16, 2021
Merged

Conversation

umlaeute
Copy link
Contributor

@umlaeute umlaeute commented Dec 7, 2021

this fixes a few crashes when running assimp info on the test-models.

notably:

  • LWOImporter: it seems there was a typo, swapping j for i (loop-vars rock!), which would create an out-of-bounds access on a vector
  • RemoveRedundantMatsProcess: this crashed on an assertion (that there are actually materials left after removing all the redundant ones). i replaced the assertion by a throwing a DeadlyImportError
    • the documentation of BaseProcess says that the process() method should raise an ImportErrorException:
      // -------------------------------------------------------------------
      /** Executes the post processing step on the given imported data.
      * A process should throw an ImportErrorException* if it fails.
      * This method must be implemented by deriving classes.
      * @param pScene The imported data to work at.
      */
      virtual void Execute(aiScene *pScene) = 0;

      however, there is no such exception and other postprocessors used the DeadlyImportError, so i used that one as well (probably the docs should be updated)

@kimkulling
Copy link
Member

Great work, thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
2 participants