Out of bounds memory access in Brox optical flow (Bug #1734)


Added by Mikhail Smirnov almost 13 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-03-31
Priority:Normal Due date:
Assignee:Vladislav Vinogradov % Done:

0%

Category:gpu (cuda)
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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

Revision 4a41107b
Added by Vladislav Vinogradov almost 13 years ago

applied patch #1734

Revision 9d263db8
Added by Roman Donchenko over 11 years ago

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

Also available in: Atom PDF