CID 11394: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::IntArray".
Assigning: "this->colorindices" = "new osg::IntArray".
The constructor allocates field "colorindices" of "struct vertexInfo" but there is no destructor.
CID 11395: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::IntArray".
Assigning: "this->coordindices" = "new osg::IntArray".
The constructor allocates field "coordindices" of "struct vertexInfo" but there is no destructor.
CID 11396: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::IntArray".
Assigning: "this->normindices" = "new osg::IntArray".
The constructor allocates field "normindices" of "struct vertexInfo" but there is no destructor.
CID 11397: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::IntArray".
Assigning: "this->txindices" = "new osg::IntArray".
The constructor allocates field "txindices" of "struct vertexInfo" but there is no destructor.
CID 11398: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec2Array".
Assigning: "this->txcoords" = "new osg::Vec2Array".
The constructor allocates field "txcoords" of "struct vertexInfo" but there is no destructor.
CID 11399: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec3Array".
Assigning: "this->norms" = "new osg::Vec3Array".
The constructor allocates field "norms" of "struct vertexInfo" but there is no destructor.
CID 11400: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec3Array".
Assigning: "this->coords" = "new osg::Vec3Array".
The constructor allocates field "coords" of "struct vertexInfo" but there is no destructor.
CID 11401: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec4Array".
Assigning: "this->colors" = "new osg::Vec4Array".
The constructor allocates field "colors" of "struct vertexInfo" but there is no destructor.
CID 11402: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec4Array".
Assigning: "this->polycols" = "new osg::Vec4Array".
The constructor allocates field "polycols" of "struct vertexInfo" but there is no destructor.
CID 11388: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new char[numBytes]".
Assigning: "this->_startPtr" = "new char[numBytes]".
The constructor allocates field "_startPtr" of "struct DataConverter" but there is no destructor.
Assigning: "this->_currentPtr" = "new char[numBytes]".
The constructor allocates field "_currentPtr" of "struct DataConverter" but there is no destructor.
CID 12263: Missing break in switch (MISSING_BREAK)
This case (value 8) is not terminated by a 'break' statement.
CID 12262: Missing break in switch (MISSING_BREAK)
This case (value 7) is not terminated by a 'break' statement.
CID 12261: Missing break in switch (MISSING_BREAK)
This case (value 6) is not terminated by a 'break' statement.
CID 10392: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.
CID 10454: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.
CID 10505: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.
CID 10919: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.
CID 10920: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.
CID 11389: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new bsp::VBSPData".
Assigning: "this->bsp_data" = "new bsp::VBSPData".
The constructor allocates field "bsp_data" of "struct bsp::VBSPReader" but the destructor and whatever functions it calls do not free it.
ID 11390: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec3Array".
Assigning: "this->vertices" = "new osg::Vec3Array".
The constructor allocates field "vertices" of "struct prims" but the destructor and whatever functions it calls do not free it.
CID 11391: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec3Array".
Assigning: "this->normals" = "new osg::Vec3Array".
The constructor allocates field "normals" of "struct prims" but the destructor and whatever functions it calls do not free it.
CID 11392: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec3Array".
Assigning: "this->txc" = "new osg::Vec3Array".
The constructor allocates field "txc" of "struct prims" but the destructor and whatever functions it calls do not free it.
CID 11393: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new osg::Vec3Array".
Assigning: "this->txcoords" = "new osg::Vec3Array".
The constructor allocates field "txcoords" of "struct prims" but the destructor and whatever functions it calls do not free it.
CID 11747: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member gset is not initialized in this constructor nor in any functions that it calls.
CID 11844: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _defaultValue is not initialized in this constructor nor in any functions that it calls.
Index: ../include/osgDB/Serializer
CID 11851: Unused pointer value (UNUSED_VALUE)
Pointer "gfd" returned by "gr->getField(26)" is never used.
CID 11850: Unused pointer value (UNUSED_VALUE)
Pointer "gfd" returned by "gr->getField(80)" is never used.
CID 11849: Unused pointer value (UNUSED_VALUE)
Pointer "gfd" returned by "gr->getField(3)" is never used.
CID 11848: Unused pointer value (UNUSED_VALUE)
Pointer "gfd" returned by "grec->getField(3)" is never used.
implement the recently introduced setSyncToVBlank-method.
Additionally I added a ToggleSyncToVBlank-eventhandler to osgViewer. I
used it to test the code, perhaps you'll find it useful and include it
in the distribution."
/** Get the file name which represents the archived file.*/
virtual std::string getArchiveFileName() const = 0;
/** return type of file. */
virtual FileType getFileType(const std::string& filename) const = 0;
/** return the contents of a directory.
* returns an empty array on any error.*/
virtual DirectoryContents getDirectoryContents(const std::string& dirName) const = 0;
Added implementations of these new methods into src/osgPlugins/osga/OSGA_Archive.h src/osgPlugins/osga/OSGA_Archive.cpp
CID 11447: Unchecked dynamic_cast (FORWARD_NULL)
Dynamic cast to pointer "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))" can return null.
Assigning null: "first" = "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))".
The clone() implementation is written using macro's so that it always returns the type of Object
being cloned so it's normally safe to assume that a dynamic_cast<> will always return a valid pointer as long
as the new T that involves creates a valid object. However, if the class being cloned doesn't correctly
implement the clone() method then their potential for the dynamic_cast to fail and will return a NULL and will
result in a memory leak of the object of paraent class that the clone would have defaulted to.
I've tightened up the CopyOp.cpp code to check the return type and added better handling of the clone in the
osg::clone() methods so thay don't have any potential mememory leaks and report warnings to OSG_WARN when
problems are encountered. It may be more apporpriate to throw an exception so will need to ponder this
issue further.
CID 11403: Logically dead code (DEADCODE)
After this line, the value of "needspace" is equal to 0.
Assigning: "needspace" = "false".
Technically the report is correct, but the code is just debugging code that was there just in case
the code needed to be reviewed. This code is long since through it's debugging stage so the code
is no longer really worth keeping so I've removed it for cleanness sake.
ID 11667: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _useVertexAttribAlias is not initialized in this constructor nor in any functions that it calls.
Member variable should have been initialized but this varaible will have always been initialized in later code
before it was used anyway so wouldn't have resulted in a runtime bug.
CID 11414: Logically dead code (DEADCODE)
After this line, the value of "vboMemory" is equal to 0.
Assigning: "vboMemory" = "NULL".
Another case of debugging code paths being picked out. I have chosen to just delete these paths as the code
looks to be working fine and less code is better than more code when it comes to maintenance.
but I've moved this initialization into the constructor to make the code more managable.
CID 11686: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member cnt is not initialized in this constructor nor in any functions that it calls.
Non-static class member maxcnt is not initialized in this constructor nor in any functions that it calls.
Non-static class member phase is not initialized in this constructor nor in any functions that it calls.
code is clean and more mantainable.
CID 11676: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member cancelMode is not initialized in this constructor nor in any functions that it calls.
Non-static class member cpunum is not initialized in this constructor nor in any functions that it calls.
Non-static class member detached is not initialized in this constructor nor in any functions that it calls.
Non-static class member isRunning is not initialized in this constructor nor in any functions that it calls.
Non-static class member stackSize is not initialized in this constructor nor in any functions that it calls.
Non-static class member threadPolicy is not initialized in this constructor nor in any functions that it calls.
Non-static class member threadPriority is not initialized in this constructor nor in any functions that it calls.
Non-static class member uniqueId is not initialized in this constructor nor in any functions that it calls.
CID 11564: Unsigned compared against 0 (NO_EFFECT)
This less-than-zero comparison of an unsigned value is never true. "cpunum < 0U".
CID 11677: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _minimumNumberAccumAlphaBits is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minimumNumberAccumBlueBits is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minimumNumberAccumGreenBits is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minimumNumberAccumRedBits is not initialized in this constructor nor in any functions that it calls.
CID 11690: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _frameLastUsed is not initialized in this constructor nor in any functions that it calls.
CID 11689: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _glBlendColor is not initialized in this constructor nor in any functions that it calls.
CID 11681: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _previousHeight is not initialized in this constructor nor in any functions that it calls.
Non-static class member _previousWidth is not initialized in this constructor nor in any functions that it calls.
CID 11688: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _previousHeight is not initialized in this constructor nor in any functions that it calls.
Non-static class member _previousWidth is not initialized in this constructor nor in any functions that it calls.
CID 11687: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _glBeginEndAdapter is not initialized in this constructor nor in any functions that it calls.
CID 11810: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _setMaxFarDistance is not initialized in this constructor nor in any functions that it calls.
CID 11811: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _displayTexturesGroupingNode is not initialized in this constructor nor in any functions that it calls.
CID 11622: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new(unsigned long long)".
Variable "<storage from new>" is not freed or pointed-to in function "osg::StateSet::StateSet()". [show details]
Assigning: "sharedStateSet" = storage returned from "new osg::StateSet".
282 osg::StateSet* sharedStateSet = new osg::StateSet;
Variable "sharedStateSet" is not freed or pointed-to in function "osg::Object::setDataVariance(osg::Object::DataVariance)". [show details]
CID 11588: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new[](unsigned long long)".
Assigning: "dataPtr" = storage returned from "new unsigned char[newTotalSize]".
Following are both false positives as the the scope they are in will always assign the object to a ref counted
structure. I've modified the code to use ref_ptr<> to just make it clear that it's underscope, although
this is not strictly neccessary as the code is OK, I introduced this for clarity and robustness in
presence of exceptions.
CID 11586: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new(unsigned long long)".
Variable "<storage from new>" is not freed or pointed-to in function "osg::VertexBufferObject::VertexBufferObject()". [show details]
Assigning: "vbo" = storage returned from "new osg::VertexBufferObject".
CID 11587: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new(unsigned long long)".
Variable "<storage from new>" is not freed or pointed-to in function "osg::ElementBufferObject::ElementBufferObject()". [show details]
Assigning: "ebo" = storage returned from "new osg::ElementBufferObject".
Pointer "indices" returned by "this->_vertexAttribList[0ULL].indices.get()" is never used."
Report highlighted the fact that later code wasn't using the indices variable when it should have been, so
potentially a higher impact that the severity suggested by Coverity.