From e21c01708a8e9bdc75435cac249b893143b9b339 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 21 May 2018 12:07:02 +0300 Subject: [PATCH] videoio: fix lifetime management of data of input frames --- modules/videoio/src/cap_ffmpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_ffmpeg.cpp b/modules/videoio/src/cap_ffmpeg.cpp index 221a63f043..25f7aa60b5 100644 --- a/modules/videoio/src/cap_ffmpeg.cpp +++ b/modules/videoio/src/cap_ffmpeg.cpp @@ -223,7 +223,7 @@ public: if (!ffmpegCapture || !icvRetrieveFrame_FFMPEG_p(ffmpegCapture, &data, &step, &width, &height, &cn)) return false; - frame.assign(cv::Mat(height, width, CV_MAKETYPE(CV_8U, cn), data, step)); + cv::Mat(height, width, CV_MAKETYPE(CV_8U, cn), data, step).copyTo(frame); return true; } virtual bool open( const cv::String& filename )