Skip to content

Commit dab81dc

Browse files
authored
PR #13962 from OhadMeir: Fix Coverity issue. Check dynamic cast success
2 parents 5adfbef + a9db53e commit dab81dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/dds/dds-adapter/lrs-device-controller.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,11 @@ size_t lrs_device_controller::get_index_of_profile( const realdds::dds_stream_pr
13011301
for( size_t i = 0; i < profiles.size(); ++i )
13021302
{
13031303
auto dds_vp = std::dynamic_pointer_cast< dds_video_stream_profile >( profiles[i] );
1304+
if( ! dds_vp )
1305+
{
1306+
LOG_ERROR( "Profile is not a video profile" << profiles[i] );
1307+
continue;
1308+
}
13041309
if( dds_vp->frequency() == profile.frequency()
13051310
&& dds_vp->encoding() == profile.encoding()
13061311
&& dds_vp->width() == profile.width()

0 commit comments

Comments
 (0)