Commit bcfd7bf4 authored by Jan Möbius's avatar Jan Möbius

Bugfix: Unchecked 0 Pointer dereference in Pluginfunctions when properties are...

Bugfix: Unchecked 0 Pointer dereference in Pluginfunctions when properties are removed and not yet reused

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2757 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 83a0d263
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -48,31 +48,31 @@ namespace PluginFunctions {
template <class MeshT , typename propT >
bool get_property_handle(MeshT* _mesh , QString _name , OpenMesh::VPropHandleT< propT > & _property ) {
std::string name(_name.toAscii( ) );
typename MeshT::prop_iterator p_it = _mesh->vprops_begin();
int idx = 0;
for ( ; p_it != _mesh->vprops_end() ; ++p_it , ++idx) {
if ( (*p_it)->name() == name ) {
if ( (*p_it) && (*p_it)->name() == name ) {
_property = ( OpenMesh::VPropHandleT< propT > )idx;
return true;
}
}
_property = OpenMesh::VPropHandleT< propT > (-1);
return false;
}
template <class MeshT , typename propT >
bool get_property_handle(MeshT* _mesh , QString _name , OpenMesh::FPropHandleT< propT > & _property ) {
std::string name (_name.toAscii( ));
typename MeshT::prop_iterator p_it = _mesh->fprops_begin();
int idx = 0;
for ( ; p_it != _mesh->fprops_end() ; ++p_it , ++idx) {
if ( (*p_it)->name() == name ) {
if ( (*p_it) && (*p_it)->name() == name ) {
_property = ( OpenMesh::FPropHandleT< propT > )idx;
return true;
}
......@@ -83,13 +83,13 @@ bool get_property_handle(MeshT* _mesh , QString _name , OpenMesh::FPropHandleT<
template <class MeshT , typename propT >
bool get_property_handle(MeshT* _mesh , QString _name , OpenMesh::HPropHandleT< propT > & _property ) {
std::string name (_name.toAscii( ));
typename MeshT::prop_iterator p_it = _mesh->hprops_begin();
int idx = 0;
for ( ; p_it != _mesh->hprops_end() ; ++p_it , ++idx) {
if ( (*p_it)->name() == name ) {
if ( (*p_it) && (*p_it)->name() == name ) {
_property = ( OpenMesh::HPropHandleT< propT > )idx;
return true;
}
......
......@@ -9,9 +9,9 @@
<ignoreparts/>
<projectdirectory>../</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description></description>
<description/>
<projectname>gui</projectname>
<defaultencoding></defaultencoding>
<defaultencoding/>
<versioncontrol>kdevsubversion</versioncontrol>
</general>
<kdevcustomproject>
......@@ -19,11 +19,11 @@
<mainprogram>/data/home1/moebius/projects/OpenFlipper/OpenFlipper</mainprogram>
<directoryradio>executable</directoryradio>
<customdirectory>/</customdirectory>
<programargs></programargs>
<programargs/>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
<globaldebugarguments></globaldebugarguments>
<globaldebugarguments/>
<globalcwd>/data/home1/moebius/projects/OpenFlipper</globalcwd>
<useglobalprogram>false</useglobalprogram>
<autoinstall>false</autoinstall>
......@@ -31,16 +31,16 @@
</run>
<build>
<buildtool>make</buildtool>
<builddir></builddir>
<builddir/>
</build>
<make>
<abortonerror>false</abortonerror>
<numberofjobs>1</numberofjobs>
<prio>0</prio>
<dontact>false</dontact>
<makebin></makebin>
<defaulttarget></defaulttarget>
<makeoptions></makeoptions>
<makebin/>
<defaulttarget/>
<makeoptions/>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
......@@ -79,8 +79,8 @@
<other>
<prio>0</prio>
<otherbin>acgmake -max</otherbin>
<defaulttarget></defaulttarget>
<otheroptions></otheroptions>
<defaulttarget/>
<otheroptions/>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
......@@ -89,12 +89,12 @@
</kdevcustomproject>
<kdevdebugger>
<general>
<dbgshell></dbgshell>
<dbgshell/>
<programargs/>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
......@@ -207,7 +207,7 @@
<resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
</codecompletion>
<creategettersetter>
<prefixGet></prefixGet>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
......@@ -220,16 +220,17 @@
<orientation>Vertical</orientation>
</splitheadersource>
<references>
<pcs>OpenFlipper</pcs>
<pcs>Qt4</pcs>
<pcs>OpenMesh2_x64</pcs>
<pcs>ACG</pcs>
<pcs>OpenFlipper</pcs>
</references>
</kdevcppsupport>
<kdevfileview>
<tree>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<hidenonprojectfiles>false</hidenonprojectfiles>
<showvcsfields>false</showvcsfields>
</tree>
<groups>
<hidenonprojectfiles>false</hidenonprojectfiles>
......@@ -243,9 +244,9 @@
</ctagspart>
<kdevdocumentation>
<projectdoc>
<docsystem></docsystem>
<docurl></docurl>
<usermanualurl></usermanualurl>
<docsystem/>
<docurl/>
<usermanualurl/>
</projectdoc>
</kdevdocumentation>
</kdevelop>
......@@ -3,28 +3,28 @@
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="8" >
<Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/TemplateModelingPlugin.cc" >
<View0 Encoding="" line="313" Type="Source" />
<View0 Encoding="" line="499" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/TemplateModelingPlugin.hh" >
<View0 Encoding="" line="266" Type="Source" />
<View0 Encoding="" line="270" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/ManipulatorPlacement.cc" >
<View0 Encoding="" line="43" Type="Source" />
<View0 Encoding="" line="56" Type="Source" />
</Doc2>
<Doc3 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/Matching.cc" >
<View0 Encoding="" line="64" Type="Source" />
<View0 Encoding="" line="207" Type="Source" />
</Doc3>
<Doc4 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/TemplateBlendingComputation.cc" >
<View0 Encoding="" line="192" Type="Source" />
<View0 Encoding="" line="0" Type="Source" />
</Doc4>
<Doc5 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/Init.cc" >
<View0 Encoding="ISO 8859-1" line="414" Type="Source" />
<View0 Encoding="ISO 8859-1" line="194" Type="Source" />
</Doc5>
<Doc6 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/DataContainerT.hh" >
<View0 Encoding="" line="95" Type="Source" />
<View0 Encoding="" line="119" Type="Source" />
</Doc6>
<Doc7 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TemplateModeling/DataContainerT.cc" >
<View0 Encoding="" line="32" Type="Source" />
<Doc7 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-Noise/NoisePlugin.cc" >
<View0 Encoding="" line="85" Type="Source" />
</Doc7>
</DocsAndViews>
<pluginList>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment