Skip to content
Snippets Groups Projects
Commit c7e2a31b authored by Campbell Barton's avatar Campbell Barton
Browse files

correct too-big allocation in mesh beautify.

parent 5e02acf8
No related branches found
No related tags found
No related merge requests found
...@@ -272,7 +272,9 @@ project_eclipse: ...@@ -272,7 +272,9 @@ project_eclipse:
check_cppcheck: check_cppcheck:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
cd $(BUILD_DIR) ; \ cd $(BUILD_DIR) ; \
python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py 2> \
$(BLENDER_DIR)/check_cppcheck.txt
@echo "written: check_cppcheck.txt"
check_clang_array: check_clang_array:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
......
...@@ -41,9 +41,9 @@ CHECKER_ARGS = [ ...@@ -41,9 +41,9 @@ CHECKER_ARGS = [
# not sure why this is needed, but it is. # not sure why this is needed, but it is.
"-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"), "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
"--suppress=*:%s/extern/glew/include/GL/glew.h:241" % project_source_info.SOURCE_DIR, "--suppress=*:%s/extern/glew/include/GL/glew.h:241" % project_source_info.SOURCE_DIR,
# "--max-configs=1", # speeds up execution "--max-configs=1", # speeds up execution
# "--check-config", # when includes are missing # "--check-config", # when includes are missing
# "--enable=all", # if you want sixty hundred pedantic suggestions "--enable=all", # if you want sixty hundred pedantic suggestions
] ]
if USE_QUIET: if USE_QUIET:
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
* *
* TODO * TODO
* - Take face normals into account. * - Take face normals into account.
* - Use a stack of rotations to perform the best onces first
* similar to edge-collapse-decimate.
*/ */
#include "BLI_math.h" #include "BLI_math.h"
...@@ -305,7 +303,7 @@ static void bm_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge ...@@ -305,7 +303,7 @@ static void bm_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge
#endif #endif
eheap = BLI_heap_new_ex(edge_array_len); eheap = BLI_heap_new_ex(edge_array_len);
eheap_table = MEM_mallocN(sizeof(HeapNode *) * bm->totedge, __func__); eheap_table = MEM_mallocN(sizeof(HeapNode *) * edge_array_len, __func__);
/* build heap */ /* build heap */
for (i = 0; i < edge_array_len; i++) { for (i = 0; i < edge_array_len; i++) {
......
...@@ -185,7 +185,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, ...@@ -185,7 +185,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
ups->brush_rotation = 0.0f; ups->brush_rotation = 0.0f;
} }
if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)
BKE_brush_randomize_texture_coordinates(ups); BKE_brush_randomize_texture_coordinates(ups);
else else
copy_v2_v2(ups->tex_mouse, mouse); copy_v2_v2(ups->tex_mouse, mouse);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment