From ee6aacee9cd50ae2df1abafb389160183c98f274 Mon Sep 17 00:00:00 2001
From: Suleyman TURKMEN <sturkmen@hotmail.com>
Date: Sun, 3 Sep 2017 03:37:30 +0300
Subject: [PATCH] Update window_gtk.cpp

Update miniflann.cpp

Update test_stereomatching.cpp
---
 modules/calib3d/test/test_stereomatching.cpp | 2 +-
 modules/flann/src/miniflann.cpp              | 2 +-
 modules/highgui/src/window_gtk.cpp           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/calib3d/test/test_stereomatching.cpp b/modules/calib3d/test/test_stereomatching.cpp
index 3806650ca1..1ad14c7930 100644
--- a/modules/calib3d/test/test_stereomatching.cpp
+++ b/modules/calib3d/test/test_stereomatching.cpp
@@ -560,7 +560,7 @@ int CV_StereoMatchingTest::processStereoMatchingResults( FileStorage& fs, int ca
     {
         absdiff( trueRightDisp, Scalar(params.dispUnknVal), rightUnknMask );
         rightUnknMask = rightUnknMask < numeric_limits<float>::epsilon();
-        assert(leftUnknMask.type() == CV_8UC1);
+        assert(rightUnknMask.type() == CV_8UC1);
     }
 
     // calculate errors
diff --git a/modules/flann/src/miniflann.cpp b/modules/flann/src/miniflann.cpp
index 8aca73c230..9c3647d455 100644
--- a/modules/flann/src/miniflann.cpp
+++ b/modules/flann/src/miniflann.cpp
@@ -553,7 +553,7 @@ static void createIndicesDists(OutputArray _indices, OutputArray _dists,
         if( !dists.isContinuous() || dists.type() != dtype ||
            dists.rows != rows || dists.cols < minCols || dists.cols > maxCols )
         {
-            if( !indices.isContinuous() )
+            if( !_dists.isContinuous() )
                 _dists.release();
             _dists.create( rows, minCols, dtype );
             dists = _dists.getMat();
diff --git a/modules/highgui/src/window_gtk.cpp b/modules/highgui/src/window_gtk.cpp
index 5bfd29e45d..91a59d2288 100644
--- a/modules/highgui/src/window_gtk.cpp
+++ b/modules/highgui/src/window_gtk.cpp
@@ -291,7 +291,7 @@ cvImageWidget_get_preferred_height (GtkWidget *widget, gint *minimal_height, gin
 
   if(image_widget->scaled_image != NULL) {
     *natural_height = *minimal_height < image_widget->scaled_image->rows ?
-      image_widget->scaled_image->cols : *minimal_height;
+      image_widget->scaled_image->rows : *minimal_height;
   }
   else {
     *natural_height = *minimal_height;
-- 
2.18.0