linux-dmabuf: Don't add invalid planes
In the buffer_params_v1_add request handler, we would post a protocol
error for an invalid plane (e.g. outside the valid range) but then we
would add it to the internal map. Since the protocol error will shut
down the client, we would never use this index for anything, so it
would not cause any problems in practice, but it could easily raise
some eyebrows. Especially since the index is used to index a static
length array later, so it has to be within the valid range or it
could cause an OOB write (but again, it would not happen in this case
since the client is disconnected).
Pick-to: 6.12
Task-number: QTBUG-148611
Change-Id: I2833521dee008f9e8bb33aadf031830a327d487c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>