Skip to content

Conversation

@Uedaki
Copy link
Contributor

@Uedaki Uedaki commented Dec 29, 2023

Fix 1

When failing to open a file (minipbrt.cpp:4676), minipbrt would call set_error() prior to the creation m_filedata allocated few lines after. This would create a crash when set_error() is trying to access the pointer to retrieve the filename and the error offset.

Fix 2

I encountered a crash when trying to triangulate a loop subdiv. It seems that the number of points was not divided by 3 after the call to float_vector_param generating a crash inside the LoopSubdiv::triangle_mesh() function which is trying to copy num_points * 3 floats from float P[num_points] to float trimesh->P[num_points * 3]. I fixed the issue by dividing the number of points by 3 when creating a loop subdiv.

@Uedaki Uedaki changed the title Fix crash when minipbrt::Loader::load(filename) could not open the file provided Fix crash when minipbrt::Loader::load(filename) could not open the file provided and crash with loop subdiv Apr 12, 2025
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

Successfully merging this pull request may close these issues.

1 participant