Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-11 00:54:32 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-11 00:54:32 +0300
commitcd2d84d91c5b6a11c72b0a5aaa7db914dbe9bdcd (patch)
treedece6866de4e8e1d976cec5fa6d9ed352f23a236 /source/blender/blenkernel/intern/mesh_remap.c
parent5357474ad8b81ce0e41907d99e9636fcc7c3a6f6 (diff)
Fix three issues reported by coverity in own recent code. Including two potential crashers.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_remap.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index 73ddb18d7b3..1deb7cfdd7f 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -1422,7 +1422,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
}
if (best_island_index != -1 && isld_steps_src) {
- best_island = island_store.islands[best_island_index];
+ best_island = use_islands ? island_store.islands[best_island_index] : NULL;
as_graph = &as_graphdata[best_island_index];
poly_island_index_map = (int *)as_graph->custom_data;
BLI_astar_solution_init(as_graph, &as_solution, false);
@@ -1488,7 +1488,8 @@ void BKE_mesh_remap_calc_loops_from_dm(
BLI_space_transform_apply(space_transform, tmp_co);
}
- pidx_src = best_island->indices[last_valid_pidx_isld_src];
+ pidx_src = use_islands ? best_island->indices[last_valid_pidx_isld_src] :
+ last_valid_pidx_isld_src;
mp_src = &polys_src[pidx_src];
ml_src = &loops_src[mp_src->loopstart];
for (j = 0; j < mp_src->totloop; j++, ml_src++) {
@@ -1564,7 +1565,8 @@ void BKE_mesh_remap_calc_loops_from_dm(
BLI_space_transform_apply(space_transform, tmp_co);
}
- pidx_src = best_island->indices[last_valid_pidx_isld_src];
+ pidx_src = use_islands ? best_island->indices[last_valid_pidx_isld_src] :
+ last_valid_pidx_isld_src;
mp_src = &polys_src[pidx_src];
/* Create that one on demand. */