From 80d2084fe66e603fdb224eb06551b5ed61f05a3a Mon Sep 17 00:00:00 2001 From: Ilies CHERGUI Date: Fri, 17 Nov 2023 12:51:45 +0000 Subject: [PATCH 2/7] v4l2allocator: Fix data offset / bytesused size validation The check was too strict causing spurious warning. Now check for <= so that 0 sized buffer do not cause a warning. Part-of: Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649] Signed-off-by: Jose Quaresma Signed-off-by: Ilies CHERGUI --- gstv4l2allocator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gstv4l2allocator.c b/gstv4l2allocator.c index 3fc4c39..6a53474 100644 --- a/gstv4l2allocator.c +++ b/gstv4l2allocator.c @@ -1505,7 +1505,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 %" -- 2.25.1