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:
Diffstat (limited to 'source/blender/blenlib/intern/scanfill_utils.c')
-rw-r--r--source/blender/blenlib/intern/scanfill_utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/scanfill_utils.c b/source/blender/blenlib/intern/scanfill_utils.c
index afa40c0b3fe..2e6abd9cb4c 100644
--- a/source/blender/blenlib/intern/scanfill_utils.c
+++ b/source/blender/blenlib/intern/scanfill_utils.c
@@ -410,7 +410,13 @@ bool BLI_scanfill_calc_self_isect(
int totvert_new = 0;
bool changed = false;
- PolyInfo *poly_info = MEM_callocN(sizeof(*poly_info) * poly_tot, __func__);
+ PolyInfo *poly_info;
+
+ if (UNLIKELY(sf_ctx->poly_nr == SF_POLY_UNSET)) {
+ return false;
+ }
+
+ poly_info = MEM_callocN(sizeof(*poly_info) * poly_tot, __func__);
/* get the polygon span */
if (sf_ctx->poly_nr == 0) {