fix: Fix toxav_basic_test buffer overflow.

We should pass the number of samples, not the byte size of `PCM`.
This commit is contained in:
iphydf 2022-01-13 22:36:13 +00:00
parent 2073d02c33
commit 28b5e512a2
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 2 additions and 3 deletions

View File

@ -12,8 +12,7 @@ branches:
protection: protection:
required_status_checks: required_status_checks:
contexts: contexts:
# TODO(iphydf): Make asan required once errors are fixed. - "bazel-asan"
#- "bazel-asan"
- "bazel-debug" - "bazel-debug"
- "bazel-release" - "bazel-release"
- "bazel-tsan" - "bazel-tsan"

View File

@ -103,7 +103,7 @@ static void iterate_tox(Tox *bootstrap, Tox *Alice, Tox *Bob)
static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error) static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error)
{ {
static const int16_t PCM[960] = {0}; static const int16_t PCM[960] = {0};
return toxav_audio_send_frame(av, 0, PCM, sizeof(PCM), 1, 48000, nullptr); return toxav_audio_send_frame(av, 0, PCM, 960, 1, 48000, nullptr);
} }
static void regular_call_flow( static void regular_call_flow(