diff --git a/modules/python/bindings/include/core/utils.hpp b/modules/python/bindings/include/core/utils.hpp index a64faf7682..baf24cea97 100644 --- a/modules/python/bindings/include/core/utils.hpp +++ b/modules/python/bindings/include/core/utils.hpp @@ -158,7 +158,7 @@ std::tuple solveSliceIndices(py::slice slice, unsigned int s endI = size + endI; } - if (endI >= static_cast(size)) { + if (endI > static_cast(size)) { throw std::runtime_error("Invalid slice indexing out of array"); } }