1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Fixed out-of-bound access to function table in cv::norm for HORM_HAMING.

This commit is contained in:
Alexander Smorkalov
2025-06-23 15:42:23 +03:00
parent 4629299163
commit c3400603d0
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -316,7 +316,7 @@ double norm( InputArray _src, int normType, InputArray _mask )
}
NormFunc func = getNormFunc(normType >> 1, depth == CV_16F ? CV_32F : depth);
CV_Assert( func != 0 );
CV_Assert( (normType >> 1) >= 3 || func != 0 );
if( src.isContinuous() && mask.empty() )
{
+2
View File
@@ -1324,6 +1324,8 @@ NormFunc getNormFunc(int normType, int depth)
}
};
if (normType >= 3 || normType < 0) return nullptr;
return normTab[normType][depth];
}