summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrung Do <trung1.dothanh@toshiba.co.jp>2021-11-01 10:08:32 +0700
committerTim-Philipp Müller <tim@centricular.com>2021-11-20 18:26:13 +0000
commitea73a9899141b4951eab5037a886e756b23533e4 (patch)
treede6f53826f3530a97a912db293f0eaeee940972c
parentd86c2da1c67f8a9cbc2a4757ee109ec87ecdb3b9 (diff)
downloadgstreamer-plugins-good-ea73a9899141b4951eab5037a886e756b23533e4.tar.gz
v4l2: Update fmt if padded height is greater than fmt height
If padded height is greater, buffer bytesused could be larger than plane length, and cause VIDIOC_QBUF failure. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1107>
-rw-r--r--sys/v4l2/gstv4l2object.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 2fb9091b5..cf32bd6bf 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -4555,6 +4555,18 @@ gst_v4l2_object_match_buffer_layout (GstV4l2Object * obj, guint n_planes,
offset[p], obj->info.offset[p], p);
need_fmt_update = TRUE;
}
+
+ if (padded_height) {
+ guint fmt_height;
+
+ if (V4L2_TYPE_IS_MULTIPLANAR (obj->type))
+ fmt_height = obj->format.fmt.pix_mp.height;
+ else
+ fmt_height = obj->format.fmt.pix.height;
+
+ if (padded_height > fmt_height)
+ need_fmt_update = TRUE;
+ }
}
if (need_fmt_update) {