v4l2: fix the critical log when unreference the buffer which memory type is...
v4l2: fix the critical log when dereference the buffer which memory type is multi-plane and contain no valid data
-
In the trick mode, driver may queue a valid buffer follow by an empty buffer which has no valid data to indicate EOS. For this empty buffer whose memory is multi-plane, the bytesused variables of v4l2_plane structure are all zero in the v4l2_plane structure.
-
Gstreamer will resize the memories by bytesused value when dequeue the buffer. And it will cause to the following critical log when dereference this empty buffer whose memory is multi-plane. The critical log: GStreamer-CRITICAL **: 16:03:01.708: gst_memory_resize: assertion 'size + mem->offset + offset <= mem->maxsize' failed.
-
For the empty buffer whose memory is multi-plane, need to resize it to maxsize variable in GstMemory structure before dereference it.