v4l2allocator: Fix data offset / bytesused size validation
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 26 Jun 2020 13:53:13 +0000 (09:53 -0400)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 26 Jun 2020 19:24:21 +0000 (19:24 +0000)
The check was too strict causing spurious warning. Now check for <= so that 0
sized buffer do not cause a warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>

sys/v4l2/gstv4l2allocator.c

index 5d95e55..4fa5d27 100644 (file)
@@ -1363,7 +1363,7 @@ gst_v4l2_allocator_dqbuf (GstV4l2Allocator * allocator,
 
       offset = group->planes[i].data_offset;
 
-      if (group->planes[i].bytesused > group->planes[i].data_offset) {
+      if (group->planes[i].bytesused >= group->planes[i].data_offset) {
         size = group->planes[i].bytesused - group->planes[i].data_offset;
       } else {
         GST_WARNING_OBJECT (allocator, "V4L2 provided buffer has bytesused %"