Out of bounds memory access in Brox optical flow (Bug #1734)
Description
In sor_pass kernel there are no checks for boundary conditions when accessing u, v, du, dv.
Suggested fix is to replace const int pos = j * stride + i;
const int pos_r = pos + 1;
const int pos_u = pos + stride;
const int pos_d = pos - stride;
const int pos_l = pos - 1;
with const int pos = j * stride + i;
const int pos_r = i < width - 1 ? pos + 1 : pos;
const int pos_u = j < height - 1 ? pos + stride : pos;
const int pos_d = j > 0 ? pos - stride : pos;
const int pos_l = i> 0 ? pos - 1 : pos;
Associated revisions
applied patch #1734
Merge pull request #1734 from asmorkalov:android_manager_version_inc
History
Updated by Anatoly Baksheev almost 13 years ago
Many thanks for patch.
Vlad, could you apply the fix?
- Assignee changed from Anatoly Baksheev to Vladislav Vinogradov
Updated by Vladislav Vinogradov almost 13 years ago
Patch was applied. Thanks!
- Status changed from Open to Done
- Target version set to 2.4.0