mirror of
https://github.com/opencv/opencv.git
synced 2025-06-19 08:54:45 +08:00
Avoid future integer overflow in _OutputArray::create
This fix is useless in 4.x and fixes harmless overflows in 5.x This belongs to 4.x as it is closer to the intended meaning.
This commit is contained in:
parent
93b607dc72
commit
e1b57057bf
@ -1294,7 +1294,7 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
|
|||||||
|
|
||||||
if(fixedType())
|
if(fixedType())
|
||||||
{
|
{
|
||||||
if(CV_MAT_CN(mtype) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 )
|
if(CV_MAT_CN(mtype) == m.channels() && ((1 << CV_MAT_DEPTH(flags)) & fixedDepthMask) != 0 )
|
||||||
mtype = m.type();
|
mtype = m.type();
|
||||||
else
|
else
|
||||||
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "Can't reallocate Mat with locked type (probably due to misused 'const' modifier)");
|
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "Can't reallocate Mat with locked type (probably due to misused 'const' modifier)");
|
||||||
|
Loading…
Reference in New Issue
Block a user