1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-17 07:04:18 +08:00

Merge pull request #2380 from cudawarped:patch_cudacodec_memory_leak

This commit is contained in:
Alexander Alekhin
2019-12-09 15:41:00 +00:00
2 changed files with 2 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ cv::cudacodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname)
// now create the actual source
CUresult cuRes = cuvidCreateVideoSource(&videoSource_, fname.c_str(), &params);
if (cuRes == CUDA_ERROR_INVALID_SOURCE)
throw std::runtime_error("");
CV_Error(Error::StsUnsupportedFormat, "Unsupported video source");
cuSafeCall( cuRes );
CUVIDEOFORMAT vidfmt;

View File

@@ -118,6 +118,7 @@ int CUDAAPI cv::cudacodec::detail::VideoParser::HandleVideoSequence(void* userDa
try
{
thiz->videoDecoder_->release();
thiz->videoDecoder_->create(newFormat);
}
catch (const cv::Exception&)