The gain change handler allowed an index equal to m_gains.size(),
which is outside the valid vector range. Reject invalid indices before
accessing the gain table to avoid undefined behavior.
found with cppcheck: Access out of bounds
Signed-off-by: Robin Getz <rgetz503@gmail.com>