Fix potential null pointer dereference

This commit is contained in:
Dmitry-Me
2015-03-05 10:31:51 +03:00
parent 0b99f6bcd6
commit d164d51380

View File

@@ -205,9 +205,12 @@ public:
void deallocate(UMatData* u) const
{
if(!u)
return;
CV_Assert(u->urefcount >= 0);
CV_Assert(u->refcount >= 0);
if(u && u->refcount == 0)
if(u->refcount == 0)
{
if( !(u->flags & UMatData::USER_ALLOCATED) )
{