Commit e04a72c
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 e04a72c
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
128 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
129 | 143 | | |
130 | 144 | | |
131 | 145 | | |
| |||
0 commit comments