From 2b45e582379f342f470b417c1fb729e5fe295e6b Mon Sep 17 00:00:00 2001 From: kkostiuk Date: Wed, 9 Mar 2022 14:17:45 -0500 Subject: [PATCH] video: prevent exception on macOS Prevent exception when getting supported frame rates. Change-Id: I2fe140bb51e0f20510b1c3f6a62df8921030dc7d --- src/media/video/osxvideo/video_device_impl.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/media/video/osxvideo/video_device_impl.mm b/src/media/video/osxvideo/video_device_impl.mm index 75191feed..dadc2a94f 100644 --- a/src/media/video/osxvideo/video_device_impl.mm +++ b/src/media/video/osxvideo/video_device_impl.mm @@ -165,7 +165,11 @@ VideoDeviceImpl::getSizeList() const std::vector VideoDeviceImpl::getRateList(const std::string& channel, VideoSize size) const { - return available_rates_.at(size); + auto it = available_rates_.find(size); + if (it != available_rates_.end()) { + return it->second; + } + return {}; } std::vector