Skip to content

Commit

Permalink
camera: Fix crash when taking photo outside CCA
Browse files Browse the repository at this point in the history
The weak pointer `camera_app_device` could be invalid outside CCA.
We should check it before using it.

(cherry picked from commit 018ae63)

Bug: 1410771
Test: Manually
Change-Id: I4d6f43f1cd0704db4fac0af18296c8a8115fdf45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4207383
Reviewed-by: Kam Kwankajornkiet <kamchonlathorn@chromium.org>
Reviewed-by: Pi-Hsun Shih <pihsun@chromium.org>
Commit-Queue: Wei Lee <wtlee@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1099669}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4227371
Auto-Submit: Wei Lee <wtlee@chromium.org>
Commit-Queue: Pi-Hsun Shih <pihsun@chromium.org>
Cr-Commit-Position: refs/branch-heads/5481@{#1009}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
Wei Lee authored and Chromium LUCI CQ committed Feb 7, 2023
1 parent faa6afb commit ed938a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions media/capture/video/chromeos/camera_device_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ void CameraDeviceDelegate::ConfigureStreams(

int32_t max_yuv_width = 0, max_yuv_height = 0;
bool is_recording_multi_stream =
camera_app_device &&
camera_app_device->GetCaptureIntent() ==
cros::mojom::CaptureIntent::VIDEO_RECORD &&
camera_app_device->IsMultipleStreamsEnabled();
Expand Down

0 comments on commit ed938a2

Please sign in to comment.