Follow-up from "v4l2codecs: Fix segfaults when VIDIOC_REQBUFS doesn't return enough buffers"
The following discussion from !1220 (merged) should be addressed:
As you can see, we have 4 arbitrary buffer allocated in that case. Perhaps we should check if the number of allocation is no less then the requested number - 4 ?
On stateful decoder, we use a copy threshold for that case. Though it can be problematic when importing DMAbuf and out of a sudden you get a system memory buffer.
If you don't have time, we can turn this thread into an issue, everything I have read here looks correct.