Skip to content

Commit 41c285f

Browse files
committed
copier: bound output format index by sink queue id
The sink queue id was used directly to index the output format array when updating parameters, unlike the other call sites which bound it. Skip a sink whose queue id exceeds the output pin count. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 950e2b1 commit 41c285f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/audio/copier/copier_generic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ void copier_update_params(struct copier_data *cd, struct comp_dev *dev,
330330
int j;
331331
j = IPC4_SRC_QUEUE_ID(buf_get_id(sink));
332332

333+
/* src_queue id is host-controlled; bound it before indexing out_fmt[] */
334+
if (j >= IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT) {
335+
comp_err(dev, "invalid src_queue id %d", j);
336+
continue;
337+
}
338+
333339
ipc4_update_buffer_format(sink, &cd->out_fmt[j]);
334340
}
335341

0 commit comments

Comments
 (0)