From aa97b0eff52343119d72b4fc48996fe62c911d37 Mon Sep 17 00:00:00 2001 From: Nir Azkiel Date: Wed, 3 Apr 2024 10:04:53 +0300 Subject: [PATCH] check dynamic cast --- src/software-sensor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/software-sensor.cpp b/src/software-sensor.cpp index f954b536ac..17e438305a 100644 --- a/src/software-sensor.cpp +++ b/src/software-sensor.cpp @@ -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;