Skip to content

check sensors exist - #13369

Merged
Nir-Az merged 2 commits into
realsenseai:developmentfrom
Nir-Az:fix-seg-fault
Sep 23, 2024
Merged

check sensors exist#13369
Nir-Az merged 2 commits into
realsenseai:developmentfrom
Nir-Az:fix-seg-fault

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Sep 23, 2024

Copy link
Copy Markdown
Collaborator

We occasionally get to create a device before we have all sensors.
This way we protect accessing the empty vectors and prevent a SEG FAULT access violation

Tracked on [RSDEV-2762]

@Nir-Az
Nir-Az requested a review from OhadMeir September 23, 2024 13:37

std::vector<std::shared_ptr<platform::uvc_device>> depth_devices;
for( auto & info : filter_by_mi( all_device_infos, 0 ) ) // Filter just mi=0, DEPTH
auto depth_devs_info = filter_by_mi( all_device_infos, 0 );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not protect D400 the same way?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considered doing it..
added

@Nir-Az
Nir-Az merged commit 9246b53 into realsenseai:development Sep 23, 2024
@Nir-Az
Nir-Az deleted the fix-seg-fault branch September 30, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants