mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 12:19:50 +01:00
Fixed out-of-bound access to function table in cv::norm for HORM_HAMING.
This commit is contained in:
parent
4629299163
commit
c3400603d0
|
|
@ -316,7 +316,7 @@ double norm( InputArray _src, int normType, InputArray _mask )
|
||||||
}
|
}
|
||||||
|
|
||||||
NormFunc func = getNormFunc(normType >> 1, depth == CV_16F ? CV_32F : depth);
|
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() )
|
if( src.isContinuous() && mask.empty() )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1324,6 +1324,8 @@ NormFunc getNormFunc(int normType, int depth)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (normType >= 3 || normType < 0) return nullptr;
|
||||||
|
|
||||||
return normTab[normType][depth];
|
return normTab[normType][depth];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user