Commit b19c9d6
committed
Handle zero-frame input callbacks and output buffer size mismatches
CoreAudio can call the input callback with 0 frames during device
transitions. The output callback already handles this case (added
for the same reason), but the input callback had an assert that
crashed the process (~21 crash pings per 30 days on macOS). Add
the same early-return pattern.
Similarly, during device format changes there can be a transient
mismatch between the output buffer size provided by CoreAudio
and the format described by output_dev_desc. The mixer assert
would crash if the buffer was too small (~19 crash pings per 30
days). Replace with a check that outputs silence and returns
early, avoiding an out-of-bounds write in the mixer.1 parent 6767a85 commit b19c9d6
1 file changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | 518 | | |
520 | 519 | | |
521 | 520 | | |
522 | 521 | | |
523 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
524 | 531 | | |
525 | 532 | | |
526 | 533 | | |
| |||
980 | 987 | | |
981 | 988 | | |
982 | 989 | | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
987 | 1001 | | |
988 | 1002 | | |
989 | 1003 | | |
| |||
0 commit comments