Fix scan coverity issues:

CID 184294: Uncaught exception
CID 183597: Unchecked return value
CID 175809: Dereference before null check
CID 175810: Logically dead code
CID 133000: Uninitialized scalar variable
CID 133001: Uninitialized scalar variable
CID 183591: Explicit null dereferenced
This commit is contained in:
wmayer
2018-11-13 16:47:58 +01:00
parent 735b0a18b9
commit a7094210f8
7 changed files with 33 additions and 26 deletions

View File

@@ -728,7 +728,7 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action)
// the nindices must have the length of numindices
int32_t vertex = 0;
int index = 0;
float t = transp[0];
float t = transp ? transp[0] : 0;
for (std::size_t i=0; i<numTria; i++) {
const SbColor& c = pcolors[i];
for (int j=0; j<3; j++) {
@@ -766,7 +766,7 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action)
// the nindices must have the length of numindices
int32_t vertex = 0;
int index = 0;
float t = transp[0];
float t = transp ? transp[0] : 0;
for (std::size_t i=0; i<numTria; i++) {
for (int j=0; j<3; j++) {
const SbColor& c = pcolors[mindices[index]];