Commit df8364ce authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Fixed "arr = NaN" case (bug #2056)

parent d54f4e1c
......@@ -306,8 +306,9 @@ Mat& Mat::operator = (const Scalar& s)
uchar* dptr;
NAryMatIterator it(arrays, &dptr, 1);
size_t elsize = it.size*elemSize();
const int64* is = (const int64*)&s.val[0];
if( s[0] == 0 && s[1] == 0 && s[2] == 0 && s[3] == 0 )
if( is[0] == 0 && is[1] == 0 && is[2] == 0 && is[3] == 0 )
{
for( size_t i = 0; i < it.nplanes; i++, ++it )
memset( dptr, 0, elsize );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment