Fix: GPU resourses were not set to nullptr after deleting, resulting in heap-use-after-free

The code has nullptr checks to make sure it doesn't try to use freed or unitiallized variables.
However the when freeing the data, the code doesn't assign the pointer to be null.
Now set them to be null

Pull Request: https://projects.blender.org/blender/blender/pulls/125090
This commit is contained in:
Sebastian Parborg
2024-07-19 17:44:22 +02:00
committed by Sebastian Parborg
parent fc8660999a
commit c09ed8a04f

View File

@@ -1149,6 +1149,9 @@ void gpu_shader_dependency_exit()
delete g_formats;
delete g_sources;
delete g_functions;
g_formats = nullptr;
g_sources = nullptr;
g_functions = nullptr;
}
GPUFunction *gpu_material_library_use_function(GSet *used_libraries, const char *name)