v4l2: respect MAX_CONTROLS limit

This commit is contained in:
Wim Taymans 2018-02-07 18:14:11 +01:00
parent 3289e3fb7e
commit c5df05d3f3

View file

@ -1029,6 +1029,9 @@ spa_v4l2_enum_controls(struct impl *this,
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED) if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
goto next; goto next;
if (port->n_controls >= MAX_CONTROLS)
goto enum_end;
ctrl_id = queryctrl.id & ~next_fl; ctrl_id = queryctrl.id & ~next_fl;
spa_pod_builder_init(&b, buffer, sizeof(buffer)); spa_pod_builder_init(&b, buffer, sizeof(buffer));