Commit dc5ffb12 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Fix NPE in VideoCaptureCamera.isZoomSupported()

Based on crash reports it appears possible for open() to return null
without throwing an exception. getCameraParameters() handles this case
gracefully by returning null but isZoomSupported() will then try to call
release() on the null Camera. The release() call is unecessary because
getCameraParameters() already releases the Camera on error.

Bug: 1149283
Change-Id: I1a5522fa3179f3b6389e5dff83a0ca379f9f44ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542785
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828012}
parent 8302f36e
...@@ -199,7 +199,6 @@ public class VideoCaptureCamera ...@@ -199,7 +199,6 @@ public class VideoCaptureCamera
} }
android.hardware.Camera.Parameters parameters = getCameraParameters(camera); android.hardware.Camera.Parameters parameters = getCameraParameters(camera);
if (parameters == null) { if (parameters == null) {
camera.release();
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment