Commit 61099f8
committed
vad : fix buffer overflow in sample reduction loop
The buffer size calculation loop (line ~6661) uses `n_samples - 1` as
the upper bound for segment_end_samples, but the copy loop (line 6696)
uses `n_samples`. This inconsistency allows the copy loop to compute
segment_length values up to 1 sample larger per segment than what was
allocated, causing heap corruption.
Symptom: `malloc(): corrupted top size` or `malloc(): invalid size
(unsorted)` crashes after VAD completes sample reduction.
Fix: Use consistent bounds (`n_samples - 1`) in both loops.
Fixes #34031 parent 19ceec8 commit 61099f8
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6693 | 6693 | | |
6694 | 6694 | | |
6695 | 6695 | | |
6696 | | - | |
| 6696 | + | |
6697 | 6697 | | |
6698 | 6698 | | |
6699 | 6699 | | |
| |||
0 commit comments