Fix possible null pointer dereference

This commit is contained in:
Dmitry-Me
2015-02-09 12:38:02 +03:00
parent 05e404c2ff
commit ea48fcfc9f

View File

@@ -107,10 +107,13 @@ 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) )
{