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


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


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

0%

Category:trash
Target version:-
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

duplicates Bug #2042: Memory Leak in V2.0 in cvDecomposeProjectionMatrix Cancelled 2012-06-13

Associated revisions

Revision 6a2fb8e5
Added by Andrey Pavlenko about 11 years ago

Merge pull request #2041 from ilya-lavrenov:tapi_mul_div

History

Updated by Andrey Kamaev over 12 years ago

Duplicate.

  • Status changed from Open to Cancelled
  • Category set to trash

Also available in: Atom PDF