Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on [AVCaptureSession addInput:] #72

Open
elikohen opened this issue Feb 14, 2017 · 1 comment
Open

Crash on [AVCaptureSession addInput:] #72

elikohen opened this issue Feb 14, 2017 · 1 comment

Comments

@elikohen
Copy link

There are no checks for errors when AVCaptureDeviceInput *deviceInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil] so if an error occurs, deviceInput will be nil and the following call to [_session addInput:deviceInput] will crash.

We cannot reproduce it on development, but we see several crashes on our production app on crashlytics:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x184aa51b8 __exceptionPreprocess
1  libobjc.A.dylib                0x1834dc55c objc_exception_throw
2  AVFoundation                   0x18c287c70 -[AVCaptureSession addInput:]
3  FastttCamera                   0x100f42170 __36-[FastttCamera _setupCaptureSession]_block_invoke.150 (FastttCamera.m:436)
4  libdispatch.dylib              0x18392e1fc _dispatch_call_block_and_release
5  libdispatch.dylib              0x18392e1bc _dispatch_client_callout
6  libdispatch.dylib              0x183932d68 _dispatch_main_queue_callback_4CF
7  CoreFoundation                 0x184a52810 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
8  CoreFoundation                 0x184a503fc __CFRunLoopRun
9  CoreFoundation                 0x18497e2b8 CFRunLoopRunSpecific
10 GraphicsServices               0x186432198 GSEventRunModal
11 UIKit                          0x18a9c57fc -[UIApplication _run]
12 UIKit                          0x18a9c0534 UIApplicationMain

Is there any reason why there are no such checks?

Thanks in advance

@bikalay
Copy link

bikalay commented Aug 25, 2022

Check if your app have permission to use camera

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants