Skip to content

Commit

Permalink
avoid reading out of index
Browse files Browse the repository at this point in the history
  • Loading branch information
meiqua committed Jun 14, 2020
1 parent 34a6b4f commit 4681727
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,10 @@ class Gauss5x1withPyrdownNode_32S_16S_4bit_smaller : public FilterNode {
for(int r = start_r; r < end_r; r++){
bool is_even_row = r % 2;
int r_down = r / 2 - padded_row / 2;
bool is_r_in_down_roi = (r_down >= 0 && r_down < out_headers[1].rows);

bool is_r_in_down_roi;
if(need_pyr_){
is_r_in_down_roi = (r_down >= 0 && r_down < out_headers[1].rows);
}
int c = start_c;
int16_t *buf_ptr = out_headers[0].ptr<int16_t>(r - op_row/2, c - op_col/2);

Expand Down Expand Up @@ -367,8 +369,10 @@ class Gauss5x1withPyrdownNode_32S_16S_4bit_smaller : public FilterNode {
for(int r = start_r; r < end_r; r++){
bool is_even_row = r % 2;
int r_down = r / 2 - padded_row / 2;
bool is_r_in_down_roi = (r_down >= 0 && r_down < out_headers[1].rows);

bool is_r_in_down_roi;
if(need_pyr_){
is_r_in_down_roi = (r_down >= 0 && r_down < out_headers[1].rows);
}
int c = start_c;
int16_t *buf_ptr = out_headers[0].ptr<int16_t>(r - op_row/2, c - op_col/2);

Expand Down

0 comments on commit 4681727

Please sign in to comment.