[Bf-blender-cvs] [a011aff] opensubdiv-modifier: Prevent crashes with meshes without faces

Sergey Sharybin noreply at git.blender.org
Mon May 12 20:09:06 CEST 2014


Commit: a011aff467655e5771b1e66be7a54bef0684c40f
Author: Sergey Sharybin
Date:   Sun May 11 20:47:01 2014 +0200
https://developer.blender.org/rBa011aff467655e5771b1e66be7a54bef0684c40f

Prevent crashes with meshes without faces

Rather strange crash from OpenSubdiv side, will investigate
it later. For now let's just not crash from Blender side.

===================================================================

M	source/blender/blenkernel/intern/CCGSubSurf.c

===================================================================

diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index b1827f9..3f23fff 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -2902,6 +2902,11 @@ static void ccgSubSurf__syncOpenSubdiv(CCGSubSurf *ss)
 {
 	BLI_assert(ss->meshIFC.numLayers == 2 || ss->meshIFC.numLayers == 3);
 
+	/* TODO(sergey): Apparently it's not supported by OpenSubdiv. */
+	if (ss->fMap->numEntries == 0) {
+		return;
+	}
+
 	/* Make sure OSD evaluator is up-to-date. */
 	if (opensubdiv_ensureEvaluator(ss)) {
 		if (ss->skip_grids == false) {




More information about the Bf-blender-cvs mailing list