Skip to content

Commit

Permalink
PR #12821 from Nir-Az: Static-analysis fix - Check dynamic cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Apr 3, 2024
2 parents 29ce06f + aa97b0e commit 24dd7ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/software-sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ frame_interface * software_sensor::allocate_new_video_frame( video_stream_profil

vid_frame->assign( profile->get_width(), profile->get_height(), stride, bpp * 8 );
auto sd = dynamic_cast< software_device * >( _owner );
if (!sd)
throw std::runtime_error("Owner is not a software device");

sd->register_extrinsic( *profile );
}
return frame;
Expand Down

0 comments on commit 24dd7ba

Please sign in to comment.