From e2423307a18e2481a5d5b6d85abcc5c107868a89 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 7 Jan 2025 11:43:16 +0100 Subject: [PATCH] fix crash in transfer vertex attributes to texture filter --- src/meshlabplugins/filter_texture/filter_texture.cpp | 1 + src/meshlabplugins/filter_texture/rastering.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index a6c4e76258..7d7601a4a2 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -986,6 +986,7 @@ void FilterTexturePlugin::transferToTexture( for (srcTexInd = 0; srcTexInd < numSrcTex; srcTexInd++) { srcTextureFileNames[srcTexInd] = srcMesh->cm.textures[srcTexInd].c_str(); + srcImgs[srcTexInd] = srcMesh->getTexture(srcMesh->cm.textures[srcTexInd]); } } diff --git a/src/meshlabplugins/filter_texture/rastering.h b/src/meshlabplugins/filter_texture/rastering.h index dab5776f51..31098c72f6 100644 --- a/src/meshlabplugins/filter_texture/rastering.h +++ b/src/meshlabplugins/filter_texture/rastering.h @@ -227,6 +227,7 @@ class TransferColorSampler TransferColorSampler(CMeshO &_srcMesh, std::vector &_trgImgs, std::vector *_srcImgs, float upperBound) : trgImgs(_trgImgs), srcImgs(_srcImgs), dist_upper_bound(upperBound) { + srcMesh=&_srcMesh; unifGridFace.Set(_srcMesh.face.begin(),_srcMesh.face.end()); markerFunctor.SetMesh(&_srcMesh); fromTexture = true;