Commit 9ec9941
committed
audio: copier: validate channels_count in copier_set_gain
channels is host-controlled (8-bit, 0-255).
Without validation it drives the memcpy length (channels * sizeof(uint16_t))
against a MAX_GAIN_COEFFS_CNT-sized stack buffer and, for channels == 0,
causes divide-by-zero in the coefficient replication loop.
Reject values outside [1, MAX_GAIN_COEFFS_CNT].
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>1 parent 3f7738d commit 9ec9941
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
0 commit comments