@@ -1107,11 +1107,14 @@ const camera_metadata_t
*CameraDevice::getStaticMetadata()
* use the maximum and minimum crop rectangles to calculate the
* digital zoom factor.
*/
+ float maxZoom = {1};
const auto info = controlsInfo.find(&controls::ScalerCrop);
- Rectangle min = info->second.min().get<Rectangle>();
- Rectangle max = info->second.max().get<Rectangle>();
- float maxZoom = std::min(1.0f * max.width / min.width,
+ if (info != controlsInfo.end()) {
+ Rectangle min = info->second.min().get<Rectangle>();
+ Rectangle max = info->second.max().get<Rectangle>();
+ maxZoom = std::min(1.0f * max.width / min.width,
1.0f * max.height / min.height);
+ }
staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
&maxZoom, 1);
The ScalerCrop control does not contain the existing check which can cause the camera HAL crash at boot. Fix it. Signed-off-by: Phi-Bang Nguyen <pnguyen@baylibre.com> --- src/android/camera_device.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) } -- Regards Phi-Bang