From 03b6cb024eafcb1ac77c25a608c4ef096cb4b596 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 22 Jun 2016 09:24:44 +0100 Subject: [PATCH] Added initializers in case ply_get_element() doesn't overwrite the values. --- src/osgPlugins/ply/vertexData.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osgPlugins/ply/vertexData.cpp b/src/osgPlugins/ply/vertexData.cpp index ed6090d31..81a279a55 100644 --- a/src/osgPlugins/ply/vertexData.cpp +++ b/src/osgPlugins/ply/vertexData.cpp @@ -221,6 +221,10 @@ void VertexData::readTriangles( PlyFile* file, const int nFaces ) // read the faces, reversing the reading direction if _invertFaces is true for( int i = 0 ; i < nFaces; i++ ) { + // initialize face values + face.nVertices = 0; + face.vertices = 0; + ply_get_element( file, static_cast< void* >( &face ) ); if (face.vertices) {