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
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-11-14 14:08:41 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-11-14 14:08:57 +0300
commit4b7fc26baed8389ecb9d0d350229b9b64ce47d03 (patch)
tree3037d393e2d1e543ebba9ff7cab34988c9dc5926 /source
parent60ffc08547476781f9b3f61c344af13fbad13ec5 (diff)
Don't assign wrong datalayers to gpuattribs in edit mode.
layer index was being obtained for loop data types but we referenced Tessface data types NULLing those out since only the data offsets are used in edit mode and address sanitizer complains about freed memory access. Also minor comment in texpainting
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 81c03d8081b..6276277be28 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2960,7 +2960,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
a = attribs->tottface++;
if (layer != -1) {
- attribs->tface[a].array = tfdata->layers[layer].data;
+ attribs->tface[a].array = NULL;
attribs->tface[a].em_offset = ldata->layers[layer].offset;
}
else {
@@ -3007,7 +3007,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
a = attribs->totmcol++;
if (layer != -1) {
- attribs->mcol[a].array = tfdata->layers[layer].data;
+ attribs->mcol[a].array = NULL;
/* odd, store the offset for a different layer type here, but editmode draw code expects it */
attribs->mcol[a].em_offset = ldata->layers[layer].offset;
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 4c7d6817707..9cc1906596f 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -1053,6 +1053,8 @@ static void uv_image_outset(float (*orig_uv)[2], float (*outset_uv)[2], const fl
}
if (is_quad) {
+ /* here we just use the orthonormality property (a1, a2) dot (a2, -a1) = 0
+ * to get normals from the edge directions based on the winding */
if (cw) {
no1[0] = -dir4[1] - dir1[1];
no1[1] = dir4[0] + dir1[0];
@@ -2543,7 +2545,6 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
float seam_subsection[4][2];
float fac1, fac2, ftot;
-
if (outset_uv[0][0] == FLT_MAX) /* first time initialize */
uv_image_outset(tf_uv_pxoffset, outset_uv, ps->seam_bleed_px, ibuf->x, ibuf->y, mf->v4 != 0, (ps->faceWindingFlags[face_index] & PROJ_FACE_WINDING_CW) == 0);