Fix NDK CameraManager crash when no cameras exist
The NDK CameraManager only lists cameras that support camera API v2. For a device that only supports v1 the list comes back empty. This results in allocating an array of size zero. This array was then intialized with a nullptr. This is fine if the array contains at least one item but in the case where there are no cameras this will cause a buffer overflow. This change removes the initialization which fixes the crash. Test: manual - ran camera CTS tests Change-Id: Ie1c872ff66997d55572fd855f20b56bd58b01752
Loading
Please register or sign in to comment