Memory Leak in V2.0 in cvDecomposeProjectionMatrix (Bug #2042)
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
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