From: Alexander Smorkalov Date: Wed, 13 Aug 2014 09:46:43 +0000 (+0400) Subject: GCC 4.8 warning array subscript is above array bounds fixed. X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~2460^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e1a5953429c6a95cc4d370ce35ac781b87b683b;p=platform%2Fupstream%2Fopencv.git GCC 4.8 warning array subscript is above array bounds fixed. tiff test fixed --- diff --git a/modules/imgcodecs/test/test_grfmt.cpp b/modules/imgcodecs/test/test_grfmt.cpp index 92238a9..54b7c21 100644 --- a/modules/imgcodecs/test/test_grfmt.cpp +++ b/modules/imgcodecs/test/test_grfmt.cpp @@ -42,6 +42,8 @@ #include "test_precomp.hpp" +#include + using namespace cv; using namespace std; diff --git a/modules/imgproc/src/floodfill.cpp b/modules/imgproc/src/floodfill.cpp index 54a1fc9..69228b3 100644 --- a/modules/imgproc/src/floodfill.cpp +++ b/modules/imgproc/src/floodfill.cpp @@ -484,6 +484,12 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask, int depth = img.depth(); int cn = img.channels(); + if ( (cn != 1) && (cn != 3) ) + { + CV_Error( CV_StsBadArg, "Number of channels in input image must be 1 or 3" ); + return; + } + if( connectivity == 0 ) connectivity = 4; else if( connectivity != 4 && connectivity != 8 )