Patch cv::cudacodec::createVideoReader() memory leak until cudacodec can be updated to miirror NVidia example code.

pull/2380/head
cudawarped 5 years ago
parent 7011e1b1cb
commit 7cb627a372
  1. 2
      modules/cudacodec/src/cuvid_video_source.cpp
  2. 1
      modules/cudacodec/src/video_parser.cpp

@ -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;

@ -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&)

Loading…
Cancel
Save