fix(mic): harden capture session shutdown
- Prevent deadlock when stopping capture - Make file recorder writes thread-safe - Add idempotent close for recorder - Cap waveIn devices and recover panics - Validate mic device range in HTTP API
This commit is contained in:
@@ -417,8 +417,8 @@ func parseMicDevice(r *http.Request) (int, error) {
|
||||
if raw := r.URL.Query().Get("device"); raw != "" {
|
||||
var err error
|
||||
device, err = strconv.Atoi(raw)
|
||||
if err != nil || device < 0 {
|
||||
return 0, errors.New("device must be 0 or greater")
|
||||
if err != nil || device < 0 || device > 64 {
|
||||
return 0, errors.New("device must be 0 through 64")
|
||||
}
|
||||
}
|
||||
return device, nil
|
||||
|
||||
Reference in New Issue
Block a user