{"action":"created","issue":{"url":"https://api.github.com/repos/KhronosGroup/OpenCOLLADA/issues/240","labels_url":"https://api.github.com/repos/KhronosGroup/OpenCOLLADA/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/OpenCOLLADA/issues/240/comments","events_url":"https://api.github.com/repos/KhronosGroup/OpenCOLLADA/issues/240/events","html_url":"https://github.com/KhronosGroup/OpenCOLLADA/issues/240","id":20440717,"number":240,"title":"PVS-Studio check","user":{"login":"AndreyKarpov","id":1468764,"avatar_url":"https://avatars.githubusercontent.com/u/1468764?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreyKarpov","html_url":"https://github.com/AndreyKarpov","followers_url":"https://api.github.com/users/AndreyKarpov/followers","following_url":"https://api.github.com/users/AndreyKarpov/following{/other_user}","gists_url":"https://api.github.com/users/AndreyKarpov/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreyKarpov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreyKarpov/subscriptions","organizations_url":"https://api.github.com/users/AndreyKarpov/orgs","repos_url":"https://api.github.com/users/AndreyKarpov/repos","events_url":"https://api.github.com/users/AndreyKarpov/events{/privacy}","received_events_url":"https://api.github.com/users/AndreyKarpov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-10-03T07:29:37Z","updated_at":"2015-05-23T00:24:23Z","closed_at":null,"body":"PVS-Studio (http://www.viva64.com/) some messages:\r\n-------------------------------------------------------------------------------\r\nV514 Dividing sizeof a pointer 'sizeof (objectGroups)' by another value. There is a probability of logical error presence. mayadmdagnode.h 40\r\n\r\nstruct ObjectGroups{\r\n  componentList objectGrpCompList;\r\n  int objectGroupId;\r\n  short objectGrpColor;\r\n  void write(FILE* file) const;\r\n}* objectGroups;\r\n\r\nvoid write(FILE* file) const\r\n{\r\n  size_t size = sizeof(objectGroups)/sizeof(ObjectGroups);\r\n  for(size_t i=0; i<size; ++i)\r\n  {\r\n    objectGroups[i].write(file);\r\n    if(i+1<size) fprintf(file,\" \");\r\n  }\r\n}\r\n\r\n#add\r\nV514 Dividing sizeof a pointer 'sizeof (compObjectGroups)' by another value. There is a probability of logical error presence. mayadmgeometryshape.h 33\r\nV514 Dividing sizeof a pointer 'sizeof (uvSetPoints)' by another value. There is a probability of logical error presence. mayadmcontrolpoint.h 27\r\nV514 Dividing sizeof a pointer 'sizeof (colorSetPoints)' by another value. There is a probability of logical error presence. mayadmcontrolpoint.h 59\r\nV514 Dividing sizeof a pointer 'sizeof (vertexFaceColor)' by another value. There is a probability of logical error presence. mayadmmesh.h 52\r\nV514 Dividing sizeof a pointer 'sizeof (vertexColor)' by another value. There is a probability of logical error presence. mayadmmesh.h 62\r\nV514 Dividing sizeof a pointer 'sizeof (vertexFaceNormal)' by another value. There is a probability of logical error presence. mayadmmesh.h 84\r\nV514 Dividing sizeof a pointer 'sizeof (vertexNormal)' by another value. There is a probability of logical error presence. mayadmmesh.h 94\r\nV514 Dividing sizeof a pointer 'sizeof (inputTargetItem)' by another value. There is a probability of logical error presence. mayadmblendshape.h 35\r\nV514 Dividing sizeof a pointer 'sizeof (targetWeights)' by another value. There is a probability of logical error presence. mayadmblendshape.h 42\r\nV514 Dividing sizeof a pointer 'sizeof (inputTargetGroup)' by another value. There is a probability of logical error presence. mayadmblendshape.h 52\r\nV514 Dividing sizeof a pointer 'sizeof (weights)' by another value. There is a probability of logical error presence. mayadmskincluster.h 24\r\nV514 Dividing sizeof a pointer 'sizeof (controlPoints)' by another value. There is a probability of logical error presence. mayadmtweak.h 24\r\nV514 Dividing sizeof a pointer 'sizeof (vertex)' by another value. There is a probability of logical error presence. mayadmtweak.h 36\r\n-------------------------------------------------------------------------------\r\nV557 Array overrun is possible. The '2' index is pointing beyond array bound. mayadmtypes.h 48\r\n\r\nstruct short2\r\n{\r\n  short values[2];\r\n  short2(short s1, short s2)\r\n  {\r\n    values[0] = s1;\r\n    values[2] = s2;\r\n  }\r\n  ....\r\n};\r\n-------------------------------------------------------------------------------\r\nV611 The memory was allocated using 'new T[]' operator but was released using the 'delete' operator. Consider inspecting this code. It's probably better to use 'delete [] buffer;'. colladamayadocumentexporter.cpp 345\r\n\r\nString DocumentExporter::mayaNameToColladaName ( const MString& str, bool removeNamespace )\r\n{\r\n  ....\r\n  char* buffer = new char[length+1];\r\n  ....\r\n  delete buffer;\r\n  ....\r\n}\r\n-------------------------------------------------------------------------------\r\nV614 Uninitialized variable 'i' used. mayadmtypes.h 1728\r\n\r\nvoid write(FILE* file) const\r\n{\r\n  fprintf(file,\"%i %i %i %i \", sDivisionCount, tDivisionCount, uDivisionCount, pointCount);\r\n  size_t size = pointCount*3;\r\n  for(size_t i; i<size; ++i)\r\n  {\r\n    fprintf(file, \"%f\", points[i]);\r\n    if(i+1<size) fprintf(file, \" \");\r\n  }\r\n}\r\n-------------------------------------------------------------------------------\r\nstruct double2\r\n{\r\n  double values[2];\r\n  double2( double d1, double d2)\r\n  {\r\n    values[0]=d1;\r\n    values[0]=d2;\r\n  }\r\n  ....\r\n}\r\n-------------------------------------------------------------------------------\r\nV576 Incorrect format. A different number of actual arguments is expected while calling 'fprintf' function. Expected: 6. Present: 5. mayadmtypes.h 657\r\n\r\nstruct vector\r\n{\r\n  double x;\r\n  double y;\r\n  double z;\r\n  void write(FILE* file) const\r\n  {\r\n    fprintf(file,\"%f %f %f %f\", x, y, z);\r\n  }\r\n};\r\n-------------------------------------------------------------------------------\r\nV603 The object was created but it is not being used. If you wish to call constructor, 'this->ParserString::ParserString(....)' should be used. generatedsaxparsertypes.h 56\r\n\r\nstruct ParserString : public UnionString\r\n{\r\n  ParserString()\r\n  {\r\n    UnionString::str = 0;\r\n    UnionString::length = 0;\r\n  }\r\n\r\n  ParserString(const int& val)\r\n  {\r\n    ParserString();\r\n  }\r\n};\r\n\r\n#add\r\nV603 The object was created but it is not being used. If you wish to call constructor, 'this->URI::URI(....)' should be used. colladabuuri.cpp 169\r\nV603 The object was created but it is not being used. If you wish to call constructor, 'this->URI::URI(....)' should be used. colladabuuri.cpp 180\r\n-------------------------------------------------------------------------------\r\n"},"comment":{"url":"https://api.github.com/repos/KhronosGroup/OpenCOLLADA/issues/comments/104806425","html_url":"https://github.com/KhronosGroup/OpenCOLLADA/issues/240#issuecomment-104806425","issue_url":"https://api.github.com/repos/KhronosGroup/OpenCOLLADA/issues/240","id":104806425,"user":{"login":"RemiArnaud","id":142521,"avatar_url":"https://avatars.githubusercontent.com/u/142521?v=3","gravatar_id":"","url":"https://api.github.com/users/RemiArnaud","html_url":"https://github.com/RemiArnaud","followers_url":"https://api.github.com/users/RemiArnaud/followers","following_url":"https://api.github.com/users/RemiArnaud/following{/other_user}","gists_url":"https://api.github.com/users/RemiArnaud/gists{/gist_id}","starred_url":"https://api.github.com/users/RemiArnaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemiArnaud/subscriptions","organizations_url":"https://api.github.com/users/RemiArnaud/orgs","repos_url":"https://api.github.com/users/RemiArnaud/repos","events_url":"https://api.github.com/users/RemiArnaud/events{/privacy}","received_events_url":"https://api.github.com/users/RemiArnaud/received_events","type":"User","site_admin":false},"created_at":"2015-05-23T00:24:23Z","updated_at":"2015-05-23T00:24:23Z","body":"what is this about ?"}}