StereoSGBM -> pointer miscalculation Line 416-419 (Bug #2201)
Description
StereoSGBM allocates a buffer in lines 374-376, which gets (and needs to get) very large when you use the 8-direction Version with large images and disparity ranges. This large buffer is then partioned into a number of arrays. In order to ease requirements for gigabytes of contiguous heap space a bit, I modified the code to have the arrays allocated individually.
Doing so, I get heap corruption after line 419 (release version) on the array pointed to by PixDiff, which I attribute to the original code, not to my changes. In the preceeding 4 lines somehow there are the same variables used for C pointer aritmetics on shorts and for byte pointer arithmetic for memset. Somewhere there a multiplication with sizeof CostType is missing. I stopped analysis here, because the original writer of the code might be much faster in fixing the bug.
My modifications are in the attached file just for information about what I did when the heap error showed up. I don't think this file is necessary or useful for anything else. But line numbers in this ticket refer to the original code.
Associated revisions
Merge pull request #2201 from mattip:2.4
History
Updated by Marina Kolpakova over 12 years ago
- Category set to calibration, 3d
Updated by Stefan Hahn over 12 years ago
I looked again into the code and found, that this is NOT a pointer miscalculation since also memset uses pointer calculation at the first parameter. Anyway, the heap corruption occurs within the lines referenced in the text.
Updated by Stefan Hahn over 12 years ago
Sorry, I was too fast. Forget about this ticket. I did the miscalculation myself when allocation the buffer.
Updated by Marina Kolpakova over 12 years ago
- Status changed from Open to Cancelled
- Target version set to 2.4.3