control: warn when we overflow the control buffer

This commit is contained in:
Wim Taymans 2024-05-09 19:33:30 +02:00
parent d7df3811e1
commit e897a8afc4
2 changed files with 12 additions and 0 deletions

View file

@ -571,6 +571,12 @@ static int process_read(struct seq_state *state)
port->buffer->buf->datas[0].chunk->offset = 0;
port->buffer->buf->datas[0].chunk->size = port->builder.state.offset;
if (port->builder.state.offset > port->buffer->buf->datas[0].maxsize) {
spa_log_warn(state->log, "control overflow: %d > %d",
port->builder.state.offset,
port->buffer->buf->datas[0].maxsize);
}
/* move buffer to ready queue */
spa_list_remove(&port->buffer->link);
SPA_FLAG_SET(port->buffer->flags, BUFFER_FLAG_OUT);

View file

@ -784,6 +784,12 @@ static int impl_node_process(void *object)
}
spa_pod_builder_pop(&builder, &f);
if (builder.state.offset > d->maxsize) {
spa_log_warn(this->log, "%p: control overflow %d > %d",
this, builder.state.offset, d->maxsize);
builder.state.offset = 0;
}
d->chunk->offset = 0;
d->chunk->size = builder.state.offset;
d->chunk->stride = 1;