Skip to content

Commit cacec38

Browse files
committed
Merge pull request #2380 from cudawarped:patch_cudacodec_memory_leak
2 parents 83ad5c6 + 7cb627a commit cacec38

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)