Commit ea48fcfc authored by Dmitry-Me's avatar Dmitry-Me

Fix possible null pointer dereference

parent 05e404c2
......@@ -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) )
{
......
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