benikabocha / saba

OpenGL Viewer (OBJ PMD PMX)
MIT License
442 stars 60 forks source link

Segfault when loading model #33

Closed brainrom closed 1 year ago

brainrom commented 1 year ago

For some models, Saba segfaults when doing PMXModel::InitializeAnimation(). m_ikTarget isn't initialized, and program finally crashes at MMDIkSolver::SolveCore(). Same behavior in saba_view, examples and direct library usage. I could post an example model, which I try to load.

benikabocha commented 1 year ago

Thanks. Could you please send me that model?

brainrom commented 1 year ago

Sure. PM'ed the model via e-mail. I'm not 100% sure, if this model are absolutely correct, but anyway it's better to throw an error, than segfault.

benikabocha commented 1 year ago

The model contained a wrong IK target. In such cases, an error message is displayed.

brainrom commented 1 year ago

Thank you. This fixed wrong IK target issue. Also found a models with some morphs loading issues and a few models with UpdateGlobalTransform() segfault issue.

benikabocha commented 1 year ago

Do you have any other incorrect models? Send that model to me and I will check it out.

brainrom commented 1 year ago

PMed via e-mail.

benikabocha commented 1 year ago

Check for loops in bone hierarchies.

brainrom commented 1 year ago

Thank you! This helps. But I discovered one more bug and finally managed to fix it on my own, sent the PR #34 I have tested all MMD models that I have, and all loaded successfully, so consider that the issue is closed.