From 79dd8111a53548011a8c4f2104de7b42bbfaf453 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 10 Jun 2016 16:30:21 +0100 Subject: [PATCH] Added missing intializers to address Coverity issue --- src/osgPlugins/txp/TXPParser.cpp | 6 +++--- src/osgPlugins/txp/trpage_geom.cpp | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/osgPlugins/txp/TXPParser.cpp b/src/osgPlugins/txp/TXPParser.cpp index cab4a245f..6a9435909 100644 --- a/src/osgPlugins/txp/TXPParser.cpp +++ b/src/osgPlugins/txp/TXPParser.cpp @@ -1313,9 +1313,9 @@ void* geomRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf) // Get the necessary info out of the geom trpgGeometry::PrimType primType; - int numPrims; - int numVert; - int numNorm; + int numPrims = 0; + int numVert = 0; + int numNorm = 0; geom.GetPrimType(primType); geom.GetNumPrims(numPrims); geom.GetNumVertex(numVert); diff --git a/src/osgPlugins/txp/trpage_geom.cpp b/src/osgPlugins/txp/trpage_geom.cpp index 53567f1dd..3fa3aebff 100644 --- a/src/osgPlugins/txp/trpage_geom.cpp +++ b/src/osgPlugins/txp/trpage_geom.cpp @@ -401,11 +401,17 @@ bool trpgGeometry::GetNumNormal(int32 &n) const { if (!isValid()) return false; if (normDataFloat.size() != 0) - n = normDataFloat.size(); + { + n = normDataFloat.size() / 3; + return true; + } if (normDataDouble.size() != 0) - n = normDataDouble.size(); - n = n / 3; - return true; + { + n = normDataDouble.size() / 3; + return true; + } + n = 0; + return false; } bool trpgGeometry::GetNormals(float32 *v) const {