All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4l-utils] v4l2-compliance: fix assert on only read/write-only controls
@ 2020-02-25 13:59 Philipp Zabel
  0 siblings, 0 replies; only message in thread
From: Philipp Zabel @ 2020-02-25 13:59 UTC (permalink / raw)
  To: linux-media; +Cc: Marian Cichy

If the driver only contains read-only (or write-only) controls,
total_vec is empty. In that case return immediately instead of
trying to access total_vec[0].

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 utils/v4l2-compliance/v4l2-test-controls.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
index 735bc5a13c09..2a3f64e8bbec 100644
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
@@ -749,6 +749,8 @@ int testExtendedControls(struct node *node)
 			multiple_classes = true;
 		total_vec.push_back(ctrl);
 	}
+	if (total_vec.empty())
+		return 0;
 
 	ctrls.count = total_vec.size();
 	ctrls.controls = &total_vec[0];
-- 
2.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-25 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 13:59 [PATCH v4l-utils] v4l2-compliance: fix assert on only read/write-only controls Philipp Zabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.