Crash in AVCamManual sample code

Originator:doronadler
Number:rdar://18891917 Date Originated:06-Nov-2014 09:54 AM
Status:Open Resolved:
Product:iOS SDK Sample-Code Product Version:Version 1.0, 2014-09-17
Classification:Crash Reproducible:Always
 
Summary:
The API "setFocusModeLockedWithLensPosition" is called without first checking that AVCaptureFocusModeLocked is supported for that camera device (In AAPLCameraViewController.m)

Steps to Reproduce:
1. Attach an iOS 8 device (Tested with iPad Mini 2, iPhone 5s)
1. Run the sample code App ("AVCamManual")
2. Tap the "Camera" labeled button at the button once to switch to the Front-Facing-Camera
3. Select "Focus" at the Segment control at the top
4. Move the "Position" Slider control
5. Observe the crash

Expected Results:
Add a line  that checks whether 'AVCaptureFocusModeLocked' is supported before calling 'setFocusModeLockedWithLensPosition' in the sample code


Actual Results:
No check is performed, the Sample App crashes

Version:
AVCamManual https://developer.apple.com/library/ios/samplecode/AVCamManual/Introduction/Intro.html#//apple_ref/doc/uid/TP40014578

Notes:
Perhaps have the documentation above 'setFocusModeLockedWithLensPosition' in AVCaptureDevice.h updated to include the scenario in which this NSInvalidArgumentException is thrown

Configuration:
It will only occur if a Camera video device which does not support "Focus mode locked" is selected (The front-facing camera)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!