make sure that the empty mat is copied to UMat properly - i.e. UMat becomes empty...
authorVadim Pisarevsky <vadim.pisarevsky@gmail.com>
Wed, 5 Oct 2016 11:07:50 +0000 (14:07 +0300)
committerVadim Pisarevsky <vadim.pisarevsky@gmail.com>
Wed, 5 Oct 2016 11:07:50 +0000 (14:07 +0300)
modules/core/src/copy.cpp
modules/videoio/src/cap_avfoundation_mac.mm

index 7149b8f..7d5e4d8 100644 (file)
@@ -263,6 +263,11 @@ void Mat::copyTo( OutputArray _dst ) const
 
     if( _dst.isUMat() )
     {
+        if( empty() )
+        {
+            _dst.release();
+            return;
+        }
         _dst.create( dims, size.p, type() );
         UMat dst = _dst.getUMat();
 
index 8c30506..ce6e3d0 100644 (file)
@@ -118,7 +118,6 @@ private:
     int height;
     int settingWidth;
     int settingHeight;
-    OSType mInputPixelFormat;
 
     int started;
 };
@@ -163,7 +162,6 @@ private:
 
     CMTime mFrameTimestamp;
     size_t mFrameNum;
-    OSType mInputPixelFormat;
 
     int started;
 };