Fix #34526: crash using mask modifier + subsurf + UV map.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 13 Mar 2013 22:15:59 +0000 (22:15 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 13 Mar 2013 22:15:59 +0000 (22:15 +0000)
source/blender/blenkernel/intern/subsurf_ccg.c

index e03100280d61d75d748e7807c95a490e7d060f05..6dd1786a38b2cfb604a027234039154643b74cc4 100644 (file)
@@ -3304,8 +3304,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
                faceFlags->mat_nr = mpoly ? mpoly[origIndex].mat_nr : 0;
                faceFlags++;
 
                faceFlags->mat_nr = mpoly ? mpoly[origIndex].mat_nr : 0;
                faceFlags++;
 
-               origIndex = base_polyOrigIndex ? base_polyOrigIndex[origIndex] : origIndex;
-
                /* set the face base vert */
                *((int *)ccgSubSurf_getFaceUserData(ss, f)) = vertNum;
 
                /* set the face base vert */
                *((int *)ccgSubSurf_getFaceUserData(ss, f)) = vertNum;
 
@@ -3413,7 +3411,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
                                                faceOrigIndex++;
                                        }
                                        if (polyOrigIndex) {
                                                faceOrigIndex++;
                                        }
                                        if (polyOrigIndex) {
-                                               *polyOrigIndex = origIndex;
+                                               *polyOrigIndex = base_polyOrigIndex ? base_polyOrigIndex[origIndex] : origIndex;
                                                polyOrigIndex++;
                                        }
 
                                                polyOrigIndex++;
                                        }