Commit 758eba9
committed
tools/probe: clamp out-of-range sample-rate index to a valid default
The 4-bit sample-rate field can select an index past the end of the
sample_rate[] table, which has fewer than 16 entries, reading out of
bounds. Clamp an out-of-range index to a valid default rate (48000 Hz)
so the read stays in bounds and the generated WAV header keeps a usable
sample rate.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>1 parent 3f7738d commit 758eba9
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
| |||
0 commit comments