diff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h
index b82d33f98658..28ea68a55af9 100644
--- a/include/libcamera/internal/matrix.h
+++ b/include/libcamera/internal/matrix.h
@@ -39,8 +39,9 @@ public:
 		std::copy(data.begin(), data.end(), data_.begin());
 	}
 
-	Matrix(const std::vector<T> &data)
+	Matrix(const Span<T> &data)
 	{
+		ASSERT(data.size() == Rows * Cols);
 		std::copy(data.begin(), data.end(), data_.begin());
 	}
 
diff --git a/src/libcamera/matrix.cpp b/src/libcamera/matrix.cpp
index c3ed54895b22..bb9fd3003996 100644
--- a/src/libcamera/matrix.cpp
+++ b/src/libcamera/matrix.cpp
@@ -31,6 +31,16 @@ LOG_DEFINE_CATEGORY(Matrix)
  * \brief Construct a zero matrix
  */
 
+/**
+ * \fn Matrix::Matrix(std::initializer_list<T> data)
+ * \brief Construct a matrix from supplied data
+ * \param[in] data Data from which to construct a matrix
+ *
+ * \a data is a one-dimensional vector and will be turned into a matrix in
+ * row-major order. The size of \a data must be equal to the product of the
+ * number of rows and columns of the matrix (Rows x Cols).
+ */
+
 /**
  * \fn Matrix::Matrix(const Span<T> &data)
  * \brief Construct a matrix from supplied data
