diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-05-26 15:51:44 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-05-26 15:52:45 +0300 |
commit | 55e3930b253e4c6687ff94b474cc9973e0c00520 (patch) | |
tree | e42fb398ce0540134e2b02c9ba0abc1b052ceef4 /source/blender/draw/intern/mesh_extractors | |
parent | 38a2576acef020566497f1d0c8c2c492de74b769 (diff) |
Fix T98392: GPU subdivision crash with knife tools
The face dots normals may not be always requested, thus leading to a
crash by null pointer dereference.
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc index c2b4d389b7c..1671a1cd1e7 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc @@ -110,8 +110,11 @@ static void extract_fdots_init_subdiv(const DRWSubdivCache *subdiv_cache, GPUVertBuf *fdots_nor_vbo = cache->final.buff.vbo.fdots_nor; GPUIndexBuf *fdots_pos_ibo = cache->final.buff.ibo.fdots; - GPU_vertbuf_init_build_on_device( - fdots_nor_vbo, get_fdots_nor_format_subdiv(), subdiv_cache->num_coarse_poly); + /* The normals may not be requested. */ + if (fdots_nor_vbo) { + GPU_vertbuf_init_build_on_device( + fdots_nor_vbo, get_fdots_nor_format_subdiv(), subdiv_cache->num_coarse_poly); + } GPU_vertbuf_init_build_on_device( fdots_pos_vbo, get_fdots_pos_format(), subdiv_cache->num_coarse_poly); GPU_indexbuf_init_build_on_device(fdots_pos_ibo, subdiv_cache->num_coarse_poly); |