Skip to content

Commit

Permalink
fix missing < 0 range check
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur authored Apr 15, 2020
1 parent 0259ddb commit bd7719f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/surface_normal_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ depth_to_normals_rgb_inner(const ImageView<const T> &depth, ImageView<uint8_t, 3
int x = center_col + j;
int y = center_row + i;

if (x >= depth.width || y >= depth.height) {
if (x < 0 || x >= depth.width || y < 0 || y >= depth.height) {
continue;
}

Expand Down Expand Up @@ -81,4 +81,4 @@ depth_to_normals_rgb_inner(const ImageView<const T> &depth, ImageView<uint8_t, 3
normals.at(center_row, center_col, 1) = f2b(normal(2));
normals.at(center_row, center_col, 2) = f2b(normal(1));
}
} // namespace surface_normal
} // namespace surface_normal

0 comments on commit bd7719f

Please sign in to comment.