Commit 5466e321 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #3687 from Dmitry-Me:fixPossibleNullPtrDeref

parents f6b82d99 ea48fcfc
...@@ -107,10 +107,13 @@ public: ...@@ -107,10 +107,13 @@ public:
void deallocate(UMatData* u) const void deallocate(UMatData* u) const
{ {
if (!u)
return;
CV_Assert(u->urefcount >= 0); CV_Assert(u->urefcount >= 0);
CV_Assert(u->refcount >= 0); CV_Assert(u->refcount >= 0);
if (u && u->refcount == 0) if (u->refcount == 0)
{ {
if ( !(u->flags & UMatData::USER_ALLOCATED) ) 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