From 52be0b64fb35ab051d24424ae7bd9ce443b3860d Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 13 Feb 2024 13:52:20 +0300 Subject: [PATCH] Fixed possible out-of-bound access in cv::Mat output formatter. --- modules/core/src/out.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/core/src/out.cpp b/modules/core/src/out.cpp index 1307ff9d03..2167f5af9f 100644 --- a/modules/core/src/out.cpp +++ b/modules/core/src/out.cpp @@ -342,9 +342,10 @@ namespace cv Ptr format(const Mat& mtx) const CV_OVERRIDE { - static const char* numpyTypes[] = + static const char* numpyTypes[CV_DEPTH_MAX] = { - "uint8", "int8", "uint16", "int16", "int32", "float32", "float64", "float16" + "uint8", "int8", "uint16", "int16", "int32", "float32", "float64", + "float16", "bfloat16", "bool", "uint64", "int64", "uint32" }; char braces[5] = {'[', ']', ',', '[', ']'}; if (mtx.cols == 1)