Commit e66f1f8
committed
fix(kokoro): stripAudio underflow, atomic streaming flag, duration floor
Three bugs found via adversarial audit:
- stripAudio: unsigned underflow when lbound < margin wraps size_t to
~2^64, causing OOB subspan. Guard subtraction with comparison first.
- isStreaming_: plain bool read/written from two threads (stream loop
vs streamStop from JS). Changed to std::atomic<bool>.
- scaleDurations: aggressive shrinking can drive individual token
durations to zero, dropping phonemes from repeatInterleave. Floor
each duration at 1 after scaling.1 parent e7b1c1b commit e66f1f8
File tree
3 files changed
+7
-5
lines changed- packages/react-native-executorch/common/rnexecutorch/models/text_to_speech/kokoro
3 files changed
+7
-5
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments