From 414babb60b5453bf2a2d206088c0b4a1b48da15e Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 7 May 2021 13:44:44 +0100 Subject: libcamera: controls: Remove merge assertion The ControlList merge operation is protected with an ASSERT to guarantee that the two lists are compatible. Unfortunately this assertion fails when we run IPAs in an isolated case as while the lists are compatible, the isolated IPA has a unique instance of the id map. This breaks the pointer comparison, and the assertion fails with a false positive. Remove the assertion, leaving only a todo in it's place as this breaks active users of the library. Bug: https://bugs.libcamera.org/show_bug.cgi?id=31 Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/controls.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libcamera/controls.cpp') diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index b763148d..5aef4e71 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -890,7 +890,17 @@ ControlList::ControlList(const ControlInfoMap &infoMap, ControlValidator *valida */ void ControlList::merge(const ControlList &source) { - ASSERT(idmap_ == source.idmap_); + /** + * \todo: ASSERT that the current and source ControlList are derived + * from a compatible ControlIdMap, to prevent undefined behaviour due to + * id collisions. + * + * This can not currently be a direct pointer comparison due to the + * duplication of the ControlIdMaps in the isolated IPA use cases. + * Furthermore, manually checking each entry of the id map is identical + * is expensive. + * See https://bugs.libcamera.org/show_bug.cgi?id=31 for further details + */ for (const auto &ctrl : source) { if (contains(ctrl.first)) { -- cgit v1.2.1