Merge pull request #4269 from 7FM/master

Fix undefined behavior caused by delete
This commit is contained in:
Alexey 2019-11-12 00:40:06 +03:00 committed by GitHub
commit 5bbbbd7c53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -734,7 +734,7 @@ int wait_for_stream(cap_cv *cap, cv::Mat* src, int dont_close)
delete src;// cvReleaseImage(&src);
int z = 0;
for (z = 0; z < 20; ++z) {
get_capture_frame_cv(cap);
src = get_capture_frame_cv(cap);
delete src;// cvReleaseImage(&src);
}
src = new cv::Mat(416, 416, CV_8UC(3)); // cvCreateImage(cvSize(416, 416), IPL_DEPTH_8U, 3);