Merge pull request #25944 from vrabaud:depth_check

Avoid future integer overflow in _OutputArray::create
pull/25952/head
Alexander Smorkalov 7 months ago committed by GitHub
commit c5de090964
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      modules/core/src/matrix_wrap.cpp

@ -1294,7 +1294,7 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
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();
else
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "Can't reallocate Mat with locked type (probably due to misused 'const' modifier)");

Loading…
Cancel
Save