From 439ef6447d23286c9365b83835ede33571fd8862 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Thu, 27 Jan 2022 22:40:39 +0300 Subject: [PATCH] Update window.cpp --- modules/highgui/src/window.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index 481fee9fbd..81d205a69a 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -963,6 +963,8 @@ void cv::imshow( const String& winname, InputArray _img ) { CV_TRACE_FUNCTION(); + const Size size = _img.size(); + CV_Assert(size.width>0 && size.height>0); { cv::AutoLock lock(cv::getWindowMutex()); cleanupClosedWindows_(); @@ -995,9 +997,7 @@ void cv::imshow( const String& winname, InputArray _img ) } } - const Size size = _img.size(); #ifndef HAVE_OPENGL - CV_Assert(size.width>0 && size.height>0); { Mat img = _img.getMat(); CvMat c_img = cvMat(img); @@ -1005,7 +1005,6 @@ void cv::imshow( const String& winname, InputArray _img ) } #else const double useGl = getWindowProperty(winname, WND_PROP_OPENGL); - CV_Assert(size.width>0 && size.height>0); if (useGl <= 0) {