Skip to content

Commit 28b5e51

Browse files
committed
fix: Fix toxav_basic_test buffer overflow.
We should pass the number of samples, not the byte size of `PCM`.
1 parent 2073d02 commit 28b5e51

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.github/settings.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ branches:
1212
protection:
1313
required_status_checks:
1414
contexts:
15-
# TODO(iphydf): Make asan required once errors are fixed.
16-
#- "bazel-asan"
15+
- "bazel-asan"
1716
- "bazel-debug"
1817
- "bazel-release"
1918
- "bazel-tsan"

auto_tests/toxav_basic_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void iterate_tox(Tox *bootstrap, Tox *Alice, Tox *Bob)
103103
static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error)
104104
{
105105
static const int16_t PCM[960] = {0};
106-
return toxav_audio_send_frame(av, 0, PCM, sizeof(PCM), 1, 48000, nullptr);
106+
return toxav_audio_send_frame(av, 0, PCM, 960, 1, 48000, nullptr);
107107
}
108108

109109
static void regular_call_flow(

0 commit comments

Comments
 (0)