1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #27472 from asmorkalov:as/norm_table_asan

Fixed out-of-bound access to function table in cv::norm for HORM_HAMING
This commit is contained in:
Alexander Smorkalov
2025-06-23 19:26:46 +03:00
committed by GitHub
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];
}