Skip to content

Conversation

@mkostersitz
Copy link

@mkostersitz mkostersitz commented Nov 1, 2025

fix(napi): validate speaker_open args and improve error messages

Replace assert-based argument handling with explicit napi_status checks
Validate and set channels, sample rate, and format with clear type errors
Only read and assign device when the 4th arg is a string; ensure proper UTF-8 copy and NUL termination
Return early with ERR_OPEN on output init/open failures
Affected: binding.c

Tested: locally with sample program

removing asserts and using napi_throw_type_error instead if non int is part of arg[0]
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

Successfully merging this pull request may close these issues.

1 participant