Skip to content

Commit

Permalink
get_distance to verify user-provided pixel indexes. Github IntelRealS…
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-mp committed Sep 22, 2019
1 parent b54f47b commit c6e1f04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,8 @@ float rs2_depth_frame_get_distance(const rs2_frame* frame_ref, int x, int y, rs2
{
VALIDATE_NOT_NULL(frame_ref);
auto df = VALIDATE_INTERFACE(((frame_interface*)frame_ref), librealsense::depth_frame);
VALIDATE_RANGE(x, 0, df->get_width() - 1);
VALIDATE_RANGE(y, 0, df->get_height() - 1);
return df->get_distance(x, y);
}
HANDLE_EXCEPTIONS_AND_RETURN(0, frame_ref, x, y)
Expand Down

0 comments on commit c6e1f04

Please sign in to comment.