Memory Leak in V2.0 in cvDecomposeProjectionMatrix (Bug #2042)


Added by Gary Gray over 12 years ago. Updated about 12 years ago.


Status:Cancelled Start date:2012-06-13
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:calibration, 3d
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

in cvDecomposeProjectionMatrix the call to cvGetCols modifies the data address of tmpMatrix here's the fix:

....
CvMat tmpMatrixSquare;//MY FIX HERE TO PREVENT MEMORY LEAK (was using tmpMatrix but that already has memory allocated
cvGetCols(projMatr, &tmpMatrixSquare, 0, 3); // M is first square matrix of P.

assert(cvDet(&tmpMatrixSquare) != 0.0); // So far only finite cameras could be decomposed, so M has to be nonsingular [det(M) != 0].

cvRQDecomp3x3(&tmpMatrixSquare, calibMatr, rotMatr, rotMatrX, rotMatrY, rotMatrZ, eulerAngles);
....

Your welcome! cost me a day
by the way v2.4 leaks like a sieve so I just went back to 2.0 and fixed that.


Related issues

duplicated by Bug #2041: Memory Leak in V2.0 in cvDecomposeProjectionMatrix Cancelled 2012-06-13

Associated revisions

Revision 9ec4c202
Added by Andrey Pavlenko about 11 years ago

Merge pull request #2042 from vpisarev:ocl_facedetect8

History

Updated by Andrey Kamaev over 12 years ago

  • Category set to calibration, 3d

Updated by Kirill Kornyakov over 12 years ago

If this is a fix, could you please attach a patch and specify the SVN revision? Otherwise it may require some additional time from maintainers... But anyway, thank you!

  • Description changed from in cvDecomposeProjectionMatrix the call to cvGetCols modifies the data addres... to in cvDecomposeProjectionMatrix the call to cvGetCols modifies the data addres... More

Updated by Vadim Pisarevsky over 12 years ago

  • Target version deleted ()

Updated by Vadim Pisarevsky over 12 years ago

ok, the latest version there should not be a memory leak inside the function; looks like the bug was fixed somewhere in between.

  • Status changed from Open to Cancelled
  • Assignee set to Vadim Pisarevsky

Updated by Andrey Kamaev about 12 years ago

  • Target version set to 2.4.3

Also available in: Atom PDF