Skip to content

Commit

Permalink
Coverity - Unchecked dynamic_cast - 3784024
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir91 committed Dec 5, 2023
1 parent b8dd374 commit f02cf93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/media/ros/ros_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ namespace librealsense
{
sensor_msgs::Image image;
auto vid_frame = dynamic_cast<librealsense::video_frame*>(frame.frame);
assert(vid_frame != nullptr);
if (!vid_frame)
throw std::runtime_error("Frame is not video frame");

image.width = static_cast<uint32_t>(vid_frame->get_width());
image.height = static_cast<uint32_t>(vid_frame->get_height());
Expand Down

0 comments on commit f02cf93

Please sign in to comment.