Commit Graph

11479 Commits

Author SHA1 Message Date
Robert Osfield
456d351a33 Fixed Coverity reported issue.
CID 11831: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _context is not initialized in this constructor nor in any functions that it calls.
Non-static class member _dc is not initialized in this constructor nor in any functions that it calls.
Non-static class member _handle is not initialized in this constructor nor in any functions that it calls.
Non-static class member _instance is not initialized in this constructor nor in any functions that it calls.
2011-05-06 12:22:10 +00:00
Robert Osfield
37f63e033a Fixed Coverity reported issue.
CID 11835: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _startTick is not initialized in this constructor nor in any functions that it calls.
2011-05-06 12:21:11 +00:00
Robert Osfield
0e56247cd0 Fixed Coverity reported issues.
CID 11834: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _tickLastUpdated is not initialized in this constructor nor in any functions that it calls.
Non-static class member _tmpText is not initialized in this constructor nor in any functions that it calls.

CID 11833: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _tmpText is not initialized in this constructor nor in any functions that it calls.
2011-05-06 12:20:48 +00:00
Robert Osfield
4a3aa2680d Fixed Coverity reported issues.
CID 11843: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _inexp is not initialized in this constructor nor in any functions that it calls.
Non-static class member _outexp is not initialized in this constructor nor in any functions that it calls.

CID 11842: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _inexp is not initialized in this constructor nor in any functions that it calls.
Non-static class member _outexp is not initialized in this constructor nor in any functions that it calls.
2011-05-06 10:30:23 +00:00
Robert Osfield
4f5152152d Fixed Coverity reported issues.
WindowManager.cpp
CID 11841: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _lastEvent is not initialized in this constructor nor in any functions that it calls.
Non-static class member _lastPush is not initialized in this constructor nor in any functions that it calls.
Non-static class member _view is not initialized in this constructor nor in any functions that it calls.

Frame.cpp
CID 11840: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _flags is not initialized in this constructor nor in any functions that it calls.

Window.cpp
CID 11839: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _index is not initialized in this constructor nor in any functions that it calls.
2011-05-06 10:29:47 +00:00
Robert Osfield
3d300c38d0 Fixed Coverity reported issue
CID 11441: Non-array delete for scalars (DELETE_ARRAY)
"_dwobj::readOpenings(_iobuf *, int)" allocates "obj.fc1". [show details]

"_dwobj::~_dwobj()" uses delete on "obj.fc1" which is an array. It should be deleted with operator delete[]. [show details]
2011-05-06 10:28:24 +00:00
Robert Osfield
07bed106af Fixed Covertiy reported issues.
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.
2011-05-06 10:27:59 +00:00
Robert Osfield
cb5a8495a7 Updated SO version number for dev release 2011-05-06 09:26:14 +00:00
Robert Osfield
8df1106957 Fixed Coverity reported issue.
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.
2011-05-06 09:22:17 +00:00
Robert Osfield
e6217e3f82 Fixed Coverity reported issue.
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.
2011-05-06 09:21:40 +00:00
Robert Osfield
12b56726d2 Fixed Coverity reported issues.
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.
2011-05-06 09:21:04 +00:00
Robert Osfield
31aa1cdfee Fixed Coverity reported issues.
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.
2011-05-06 09:20:06 +00:00
Robert Osfield
67c12b14b0 Fixed Coverity reported issues by using ref_ptr<> for object.
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.
2011-05-06 09:19:27 +00:00
Robert Osfield
02e97c0f79 Fixed build problem 2011-05-06 09:00:46 +00:00
Robert Osfield
bf9cc20ef0 Fixed Coverity reported issue.
CID 11845: Structurally dead code (UNREACHABLE)
This code cannot be reached: "<temporary>.basic_string("");".
2011-05-05 12:40:03 +00:00
Robert Osfield
b0f6783631 Fixed Coverity reported issue.
CID 11855: Use after free (USE_AFTER_FREE)
"operator delete[](void *)" frees "buffer".
2011-05-05 12:39:35 +00:00
Robert Osfield
9a8edde316 Fixed Coverity reported issue. This fix addresses a memory leak.
CID 11847: Unused pointer value (UNUSED_VALUE)
Pointer "node" returned by "lib3ds_node_new(LIB3DS_NODE_CAMERA)" is never used.
2011-05-05 12:38:48 +00:00
Robert Osfield
fbfc19d3ec Fixed Coverity reported issue.
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
2011-05-05 12:37:00 +00:00
Robert Osfield
f0b0a8788b Fixed warning 2011-05-05 11:31:12 +00:00
Robert Osfield
69e205b8a1 Fixed Coverity reported issue.
CID 11864: Wrapper object use after free (WRAPPER_ESCAPE)
Assigning: "szFilename" = "path.c_str()", which extracts wrapped state from local "path".
2011-05-05 11:27:34 +00:00
Robert Osfield
ee9db5e5ba Fixed 4 Coverity reported issues
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.
2011-05-05 10:31:34 +00:00
Robert Osfield
9ea9ac728f Fixed typo 2011-05-05 10:28:34 +00:00
Robert Osfield
47f1133c25 From Mathias Froehlich, build fix for gcc 4.6 2011-05-04 16:36:35 +00:00
Robert Osfield
da1a354502 From Stephan Huber, "attached you'll find a small enhancement for GraphicsWindowCocoa to
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."
2011-05-04 16:01:21 +00:00
Robert Osfield
f0baf6abba Removed unncessary references to FREETYPE 2011-05-04 09:53:11 +00:00
Robert Osfield
51f921f68e From Michael Platings, fix for build with cmake 2.6.x 2011-05-04 09:48:10 +00:00
Robert Osfield
ff99fd07f7 Added OSGVIEWER_EXPORT 2011-05-03 12:43:00 +00:00
Robert Osfield
81a0eed67f Added missing break; 2011-05-03 10:14:34 +00:00
Robert Osfield
4e22a20f94 From Michael Platings, "I've updated the FBX plugin to use the latest FBX SDK (2012.1). Please apply the attached .cmake which finds the correct SDK headers & libraries." 2011-05-03 09:58:31 +00:00
Michael PLATINGS
c7814cf50a Updated to use FBX SDK 2012.1 2011-05-03 09:11:04 +00:00
Robert Osfield
b78ad29429 Improved the handling of different combinations of slashes and dirNames. 2011-04-29 16:50:45 +00:00
Robert Osfield
b4353c1a8e Added following methods to osgDB::Archive in support of work by Fradley Anderegg on .zip archive support:
/** 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
2011-04-29 16:34:26 +00:00
Robert Osfield
fb09d0e553 Refactored the libtiffOStreamSeekProc function so that it extendeds the stream when the
requested file position is beyond the current end of the stream.  This fix addresses
a bug that occurred when writting to a streamstream.
2011-04-29 14:31:45 +00:00
Robert Osfield
7e7e5405ef Update ChangeLog 2011-04-29 09:16:47 +00:00
Robert Osfield
41eb850578 Fixed Coverity reported issue.
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.
2011-04-28 16:33:14 +00:00
Robert Osfield
c379431be3 Fixed Coverity reported issue.
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.
2011-04-28 10:23:50 +00:00
Robert Osfield
f9d217ea07 Fixed Coverity reported issue.
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.
2011-04-28 10:23:28 +00:00
Robert Osfield
bef8dedce0 Fixed Coverity reported issue.
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.
2011-04-28 10:22:20 +00:00
Robert Osfield
c32b72e8c5 Fixed Coverity reported issue. Issue is benign as all the member variables are initialized in after construction,
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.
2011-04-27 16:37:25 +00:00
Robert Osfield
718fa5b679 Fixed 2 Coverity reported issues. Both issues are benign, but I've addressed then as with the changes the
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".
2011-04-27 16:35:34 +00:00
Robert Osfield
91430e9c54 Fixed Coverity reported issue.
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.
2011-04-27 16:06:32 +00:00
Robert Osfield
688b1614ad Fixed Coverity reported issue.
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.
2011-04-27 16:06:10 +00:00
Robert Osfield
e962eda7d5 Fixed Coverity reported issue.
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.
2011-04-27 16:05:37 +00:00
Robert Osfield
4751f03529 Fixed 2 Coverity reported issues.
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.
2011-04-27 16:05:13 +00:00
Robert Osfield
7e6f05b864 Fixed Coverity reported issue, in this case it's a unused member variable so could just be deleted.
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.
2011-04-27 16:04:37 +00:00
Robert Osfield
d20d2202a4 Fixed 3 Coverity reported issues. CID 11622 is a bit of false positive as for valid settings no leak would happen.
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]
2011-04-27 16:03:37 +00:00
Robert Osfield
63ee77a63d Fixed Coverity reported issue.
CID 11588: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new[](unsigned long long)".
Assigning: "dataPtr" = storage returned from "new unsigned char[newTotalSize]".
2011-04-27 16:02:10 +00:00
Robert Osfield
501008f256 Fixed 2 Coverity reported issues.
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".
2011-04-27 16:01:43 +00:00
Robert Osfield
9a4c277592 Fixed Coverity reported issue.
CID 11636: Allocation size mismatch (SIZECHECK)
"my_alloc(sizeof (struct PlyProperty) /*36*/ * elem->nprops, 1292, "..\\..\\..\\..\\src\\osgPlugins\\ply\\plyfile.cpp")" allocates memory. [show details]
Allocating a multiple of 36 bytes to pointer "other->props", which needs 8 bytes.
2011-04-27 16:00:32 +00:00
Robert Osfield
e345a7bacd Fixed 1 Coverity Low Impact issue "Unused pointer value (UNUSED_VALUE)
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.
2011-04-26 19:31:04 +00:00