Skip to content

Commit 80c2d6c

Browse files
committed
Fix CoreAudio driver crash when starting input with uninitialized device
Initialize input device if null before starting audio input to prevent crashes when input_unit is not yet initialized.
1 parent 019889d commit 80c2d6c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/coreaudio/audio_driver_coreaudio.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@
520520
}
521521

522522
Error AudioDriverCoreAudio::input_start() {
523+
ERR_FAIL_NULL_V(input_unit, FAILED);
524+
523525
input_buffer_init(capture_buffer_frames);
524526

525527
OSStatus result = AudioOutputUnitStart(input_unit);

0 commit comments

Comments
 (0)