Skip to content

Commit 7cb627a

Browse files
committed
Patch cv::cudacodec::createVideoReader() memory leak until cudacodec can be updated to miirror NVidia example code.
1 parent 7011e1b commit 7cb627a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/cudacodec/src/cuvid_video_source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ cv::cudacodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname)
6262
// now create the actual source
6363
CUresult cuRes = cuvidCreateVideoSource(&videoSource_, fname.c_str(), &params);
6464
if (cuRes == CUDA_ERROR_INVALID_SOURCE)
65-
throw std::runtime_error("");
65+
CV_Error(Error::StsUnsupportedFormat, "Unsupported video source");
6666
cuSafeCall( cuRes );
6767

6868
CUVIDEOFORMAT vidfmt;

modules/cudacodec/src/video_parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ int CUDAAPI cv::cudacodec::detail::VideoParser::HandleVideoSequence(void* userDa
118118

119119
try
120120
{
121+
thiz->videoDecoder_->release();
121122
thiz->videoDecoder_->create(newFormat);
122123
}
123124
catch (const cv::Exception&)

0 commit comments

Comments
 (0)