When explicit_update is false , the update_buffers() function (line 1412) can still be called. vertex_buffer and index_buffer are initially null because persistent buffers are not created. However, the current code directly accesses vertex_buffer->get_handle() and vertex_buffer->get_size() without checking if the pointers are valid, causing a null pointer dereference.
Proposed Fix
Add null pointer checks before accessing vertex_buffer and index_buffer:
if (!vertex_buffer || !vertex_buffer->get_handle() || (vertex_buffer_size != vertex_buffer->get_size()))
{
// Create buffer if needed
}
When explicit_update is false , the update_buffers() function (line 1412) can still be called. vertex_buffer and index_buffer are initially null because persistent buffers are not created. However, the current code directly accesses vertex_buffer->get_handle() and vertex_buffer->get_size() without checking if the pointers are valid, causing a null pointer dereference.
Proposed Fix
Add null pointer checks before accessing vertex_buffer and index_buffer: