diff --git a/apps/createsamples/utility.cpp b/apps/createsamples/utility.cpp index 0ec7e8cb6e..ab1ca1c789 100644 --- a/apps/createsamples/utility.cpp +++ b/apps/createsamples/utility.cpp @@ -1044,12 +1044,10 @@ void cvCreateTrainingSamples( const char* filename, output = fopen( filename, "wb" ); if( output != NULL ) { - int hasbg; int i; int inverse; - hasbg = 0; - hasbg = (bgfilename != NULL && icvInitBackgroundReaders( bgfilename, + const int hasbg = (bgfilename != NULL && icvInitBackgroundReaders( bgfilename, Size( winwidth,winheight ) ) ); Mat sample( winheight, winwidth, CV_8UC1 ); diff --git a/modules/calib3d/src/circlesgrid.cpp b/modules/calib3d/src/circlesgrid.cpp index 25da6be03f..2d1a817629 100644 --- a/modules/calib3d/src/circlesgrid.cpp +++ b/modules/calib3d/src/circlesgrid.cpp @@ -224,7 +224,7 @@ void CirclesGridClusterFinder::findOutsideCorners(const std::vector CV_Assert(!corners.empty()); outsideCorners.clear(); //find two pairs of the most nearest corners - int i, j, n = (int)corners.size(); + const size_t n = corners.size(); #ifdef DEBUG_CIRCLES Mat cornersImage(1024, 1248, CV_8UC1, Scalar(0)); @@ -232,22 +232,22 @@ void CirclesGridClusterFinder::findOutsideCorners(const std::vector imshow("corners", cornersImage); #endif - std::vector tangentVectors(corners.size()); - for(size_t k=0; k tangentVectors(n); + for(size_t k=0; k < n; k++) { - Point2f diff = corners[(k + 1) % corners.size()] - corners[k]; + Point2f diff = corners[(k + 1) % n] - corners[k]; tangentVectors[k] = diff * (1.0f / norm(diff)); } //compute angles between all sides - Mat cosAngles(n, n, CV_32FC1, 0.0f); - for(i = 0; i < n; i++) + Mat cosAngles((int)n, (int)n, CV_32FC1, 0.0f); + for(size_t i = 0; i < n; i++) { - for(j = i + 1; j < n; j++) + for(size_t j = i + 1; j < n; j++) { float val = fabs(tangentVectors[i].dot(tangentVectors[j])); - cosAngles.at(i, j) = val; - cosAngles.at(j, i) = val; + cosAngles.at((int)i, (int)j) = val; + cosAngles.at((int)j, (int)i) = val; } } @@ -276,10 +276,10 @@ void CirclesGridClusterFinder::findOutsideCorners(const std::vector const int bigDiff = 4; if(maxIdx - minIdx == bigDiff) { - minIdx += n; + minIdx += (int)n; std::swap(maxIdx, minIdx); } - if(maxIdx - minIdx != n - bigDiff) + if(maxIdx - minIdx != (int)n - bigDiff) { return; } diff --git a/modules/calib3d/src/dls.cpp b/modules/calib3d/src/dls.cpp index b0334c4268..8f814f0d37 100644 --- a/modules/calib3d/src/dls.cpp +++ b/modules/calib3d/src/dls.cpp @@ -206,7 +206,7 @@ void dls::run_kernel(const cv::Mat& pp) void dls::build_coeff_matrix(const cv::Mat& pp, cv::Mat& Mtilde, cv::Mat& D) { - CV_Assert(!pp.empty()); + CV_Assert(!pp.empty() && N > 0); cv::Mat eye = cv::Mat::eye(3, 3, CV_64F); // build coeff matrix diff --git a/modules/calib3d/test/test_chesscorners.cpp b/modules/calib3d/test/test_chesscorners.cpp index 2da1b12e25..8303a8dcd4 100644 --- a/modules/calib3d/test/test_chesscorners.cpp +++ b/modules/calib3d/test/test_chesscorners.cpp @@ -334,19 +334,19 @@ bool validateData(const ChessBoardGenerator& cbg, const Size& imgSz, tmp = cv::norm(cur - mat(i + 1, j + 1)); // TODO cvtest if (tmp < minNeibDist) - tmp = minNeibDist; + minNeibDist = tmp; tmp = cv::norm(cur - mat(i - 1, j + 1)); // TODO cvtest if (tmp < minNeibDist) - tmp = minNeibDist; + minNeibDist = tmp; tmp = cv::norm(cur - mat(i + 1, j - 1)); // TODO cvtest if (tmp < minNeibDist) - tmp = minNeibDist; + minNeibDist = tmp; tmp = cv::norm(cur - mat(i - 1, j - 1)); // TODO cvtest if (tmp < minNeibDist) - tmp = minNeibDist; + minNeibDist = tmp; } const double threshold = 0.25; diff --git a/modules/core/src/persistence_json.cpp b/modules/core/src/persistence_json.cpp index ef0c3a49f5..fe87647337 100644 --- a/modules/core/src/persistence_json.cpp +++ b/modules/core/src/persistence_json.cpp @@ -123,7 +123,6 @@ static char* icvJSONParseKey( CvFileStorage* fs, char* ptr, CvFileNode* map, CvF CV_PARSE_ERROR( "Key must start with \'\"\'" ); char * beg = ptr + 1; - char * end = beg; do { ++ptr; @@ -133,7 +132,7 @@ static char* icvJSONParseKey( CvFileStorage* fs, char* ptr, CvFileNode* map, CvF if( *ptr != '"' ) CV_PARSE_ERROR( "Key must end with \'\"\'" ); - end = ptr; + const char * end = ptr; ptr++; ptr = icvJSONSkipSpaces( fs, ptr ); if ( ptr == 0 || fs->dummy_eof ) @@ -576,12 +575,12 @@ void icvJSONParse( CvFileStorage* fs ) if ( *ptr == '{' ) { CvFileNode* root_node = (CvFileNode*)cvSeqPush( fs->roots, 0 ); - ptr = icvJSONParseMap( fs, ptr, root_node ); + icvJSONParseMap( fs, ptr, root_node ); } else if ( *ptr == '[' ) { CvFileNode* root_node = (CvFileNode*)cvSeqPush( fs->roots, 0 ); - ptr = icvJSONParseSeq( fs, ptr, root_node ); + icvJSONParseSeq( fs, ptr, root_node ); } else { @@ -668,7 +667,7 @@ void icvJSONWrite( CvFileStorage* fs, const char* key, const char* data ) *ptr++ = '\n'; *ptr++ = '\0'; ::icvPuts( fs, fs->buffer_start ); - ptr = fs->buffer = fs->buffer_start; + fs->buffer = fs->buffer_start; } ptr = icvFSFlush(fs); } diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index ad480eb8d3..7e20f153c8 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -1014,8 +1014,8 @@ protected: Size mSize(rng.uniform(minMSize, maxMSize), rng.uniform(minMSize, maxMSize)); size_t mvSize = rng.uniform(1, maxMvSize); - int res = cvtest::TS::OK, curRes = res; - curRes = run_case(CV_8U, mvSize, mSize, rng); + int res = cvtest::TS::OK; + int curRes = run_case(CV_8U, mvSize, mSize, rng); res = curRes != cvtest::TS::OK ? curRes : res; curRes = run_case(CV_8S, mvSize, mSize, rng); diff --git a/modules/core/test/test_rand.cpp b/modules/core/test/test_rand.cpp index 34b32a7e53..6504649842 100644 --- a/modules/core/test/test_rand.cpp +++ b/modules/core/test/test_rand.cpp @@ -375,9 +375,11 @@ TEST(Core_Rand, Regression_Stack_Corruption) int bufsz = 128; //enough for 14 doubles AutoBuffer buffer(bufsz); size_t offset = 0; - cv::Mat_ x(2, 3, (cv::Point2d*)(buffer.data()+offset)); offset += x.total()*x.elemSize(); - double& param1 = *(double*)(buffer.data()+offset); offset += sizeof(double); - double& param2 = *(double*)(buffer.data()+offset); offset += sizeof(double); + cv::Mat_ x(2, 3, (cv::Point2d*)(buffer.data()+offset)); + offset += x.total()*x.elemSize(); + double& param1 = *(double*)(buffer.data()+offset); + offset += sizeof(double); + double& param2 = *(double*)(buffer.data()+offset); param1 = -9; param2 = 2; cv::theRNG().fill(x, cv::RNG::NORMAL, param1, param2); diff --git a/modules/dnn/src/layers/convolution_layer.cpp b/modules/dnn/src/layers/convolution_layer.cpp index 23f99e7a6b..d08dec548b 100644 --- a/modules/dnn/src/layers/convolution_layer.cpp +++ b/modules/dnn/src/layers/convolution_layer.cpp @@ -560,7 +560,7 @@ public: int ngroups = ngroups_, batchSize = input_->size[0]*ngroups; int outW = output_->size[3], outH = output_->size[2], outCn = output_->size[1]/ngroups; int width = input_->size[3], height = input_->size[2], inpCn = input_->size[1]/ngroups; - int nstripes = nstripes_; + const int nstripes = nstripes_; int kernel_w = kernel_.width, kernel_h = kernel_.height; int pad_w = pad_.width, pad_h = pad_.height; int stride_w = stride_.width, stride_h = stride_.height; @@ -587,7 +587,6 @@ public: int samplesPerStripe = std::max((batchSize + nstripes - 1)/nstripes, 1); r.start *= samplesPerStripe; r.end *= samplesPerStripe; - nstripes *= samplesPerStripe; stripeSize = outPlaneSize; } diff --git a/modules/dnn/src/layers/eltwise_layer.cpp b/modules/dnn/src/layers/eltwise_layer.cpp index 8eb3ff4a68..442bfa7aff 100644 --- a/modules/dnn/src/layers/eltwise_layer.cpp +++ b/modules/dnn/src/layers/eltwise_layer.cpp @@ -187,7 +187,7 @@ public: int c, j, k, n = nsrcs; const float* coeffsptr = coeffs && !coeffs->empty() ? &coeffs->at(0) : 0; float* dstptr0 = dst->ptr(); - int blockSize0 = 1 << 12, blockSize = blockSize0; + int blockSize0 = 1 << 12, blockSize; for( size_t ofs = stripeStart; ofs < stripeEnd; ofs += blockSize ) { diff --git a/modules/dnn/src/layers/normalize_bbox_layer.cpp b/modules/dnn/src/layers/normalize_bbox_layer.cpp index a846dabfb0..86a56915a2 100644 --- a/modules/dnn/src/layers/normalize_bbox_layer.cpp +++ b/modules/dnn/src/layers/normalize_bbox_layer.cpp @@ -190,6 +190,7 @@ public: size_t num = total(shape(inp0.size), 0, startAxis); size_t numPlanes = total(shape(inp0.size), startAxis, endAxis + 1); + CV_Assert(num * numPlanes != 0); size_t planeSize = inp0.total() / (num * numPlanes); for (size_t n = 0; n < num; ++n) { diff --git a/modules/dnn/src/layers/recurrent_layers.cpp b/modules/dnn/src/layers/recurrent_layers.cpp index 46796778a9..b356b7627c 100644 --- a/modules/dnn/src/layers/recurrent_layers.cpp +++ b/modules/dnn/src/layers/recurrent_layers.cpp @@ -189,18 +189,16 @@ public: else outTailShape_.assign(1, _numOut); - int _numTimeStamps, _numSamples; + int _numSamples; if (useTimestampDim) { CV_Assert(inp0.size() >= 2 && total(inp0, 2) == _numInp); - _numTimeStamps = inp0[0]; _numSamples = inp0[1]; - outResShape.push_back(_numTimeStamps); + outResShape.push_back(inp0[0]); } else { CV_Assert(inp0.size() >= 2 && total(inp0, 1) == _numInp); - _numTimeStamps = 1; _numSamples = inp0[0]; } diff --git a/modules/features2d/src/brisk.cpp b/modules/features2d/src/brisk.cpp index 5e233d0d8f..4038279d75 100644 --- a/modules/features2d/src/brisk.cpp +++ b/modules/features2d/src/brisk.cpp @@ -1236,7 +1236,6 @@ BriskScaleSpace::isMax2D(const int layer, const int x_layer, const int y_layer) { // in this case, we have to analyze the situation more carefully: // the values are gaussian blurred and then we really decide - data = scores.ptr() + y_layer * scorescols + x_layer; int smoothedcenter = 4 * center + 2 * (s_10 + s10 + s0_1 + s01) + s_1_1 + s1_1 + s_11 + s11; for (unsigned int i = 0; i < deltasize; i += 2) { @@ -1312,8 +1311,7 @@ BriskScaleSpace::refine3D(const int layer, const int x_layer, const int y_layer, int s_2_2 = l.getAgastScore_5_8(x_layer + 1, y_layer + 1, 1); max_below = std::max(s_2_2, max_below); - max_below_float = subpixel2D(s_0_0, s_0_1, s_0_2, s_1_0, s_1_1, s_1_2, s_2_0, s_2_1, s_2_2, delta_x_below, - delta_y_below); + subpixel2D(s_0_0, s_0_1, s_0_2, s_1_0, s_1_1, s_1_2, s_2_0, s_2_1, s_2_2, delta_x_below, delta_y_below); max_below_float = (float)max_below; } else diff --git a/modules/features2d/src/kaze/KAZEFeatures.cpp b/modules/features2d/src/kaze/KAZEFeatures.cpp index 0cc52d9117..58f0937f00 100644 --- a/modules/features2d/src/kaze/KAZEFeatures.cpp +++ b/modules/features2d/src/kaze/KAZEFeatures.cpp @@ -373,8 +373,6 @@ void KAZEFeatures::Determinant_Hessian(std::vector& kpts) is_out = true; } - is_out = false; - if (is_out == false) { if (is_repeated == false) { kpts.push_back(kpts_par_[i][j]); diff --git a/modules/imgcodecs/src/exif.cpp b/modules/imgcodecs/src/exif.cpp index 350123431c..22b4f224ce 100644 --- a/modules/imgcodecs/src/exif.cpp +++ b/modules/imgcodecs/src/exif.cpp @@ -175,7 +175,6 @@ std::map ExifReader::getExif() CV_THROW (ExifParsingError()); } m_stream.read( reinterpret_cast(&m_data[0]), exifSize - offsetToTiffHeader ); - count = m_stream.gcount(); exifFound = true; break; diff --git a/modules/imgcodecs/src/grfmt_bmp.cpp b/modules/imgcodecs/src/grfmt_bmp.cpp index fcfd834e4a..798b2d9446 100644 --- a/modules/imgcodecs/src/grfmt_bmp.cpp +++ b/modules/imgcodecs/src/grfmt_bmp.cpp @@ -265,7 +265,7 @@ bool BmpDecoder::readData( Mat& img ) for(;;) { int code = m_strm.getWord(); - int len = code & 255; + const int len = code & 255; code >>= 8; if( len != 0 ) // encoded mode { @@ -304,16 +304,13 @@ bool BmpDecoder::readData( Mat& img ) else { int x_shift3 = (int)(line_end - data); - int y_shift = m_height - y; if( code == 2 ) { x_shift3 = m_strm.getByte()*nch; - y_shift = m_strm.getByte(); + m_strm.getByte(); } - len = x_shift3 + ((y_shift * width3) & ((code == 0) - 1)); - if( color ) data = FillUniColor( data, line_end, step, width3, y, m_height, x_shift3, diff --git a/modules/imgcodecs/src/grfmt_pam.cpp b/modules/imgcodecs/src/grfmt_pam.cpp index 9c9aa9e79e..d1a2161733 100644 --- a/modules/imgcodecs/src/grfmt_pam.cpp +++ b/modules/imgcodecs/src/grfmt_pam.cpp @@ -689,7 +689,7 @@ bool PAMEncoder::write( const Mat& img, const std::vector& params ) tmp += sprintf( buffer + tmp, "MAXVAL %d\n", (1 << img.elemSize1()*8) - 1); if (fmt) tmp += sprintf( buffer + tmp, "TUPLTYPE %s\n", fmt->name ); - tmp += sprintf( buffer + tmp, "ENDHDR\n" ); + sprintf( buffer + tmp, "ENDHDR\n" ); strm.putBytes( buffer, (int)strlen(buffer) ); /* write data */ diff --git a/modules/imgcodecs/src/grfmt_tiff.cpp b/modules/imgcodecs/src/grfmt_tiff.cpp index 8dcbe5b672..69dc4261ac 100644 --- a/modules/imgcodecs/src/grfmt_tiff.cpp +++ b/modules/imgcodecs/src/grfmt_tiff.cpp @@ -255,22 +255,21 @@ bool TiffDecoder::readHeader() { case 8: m_type = CV_MAKETYPE(CV_8U, photometric > 1 ? wanted_channels : 1); + result = true; break; case 16: m_type = CV_MAKETYPE(CV_16U, photometric > 1 ? wanted_channels : 1); + result = true; break; - case 32: m_type = CV_MAKETYPE(CV_32F, photometric > 1 ? 3 : 1); + result = true; break; case 64: m_type = CV_MAKETYPE(CV_64F, photometric > 1 ? 3 : 1); + result = true; break; - - default: - result = false; } - result = true; } } diff --git a/modules/imgproc/src/contours.cpp b/modules/imgproc/src/contours.cpp index 10f7744c1f..eb47816c86 100644 --- a/modules/imgproc/src/contours.cpp +++ b/modules/imgproc/src/contours.cpp @@ -855,7 +855,6 @@ icvTraceContour_32s( int *ptr, int step, int *stop_ptr, int is_hole ) for( ;; ) { CV_Assert(i3 != NULL); - s_end = s; s = std::min(s, MAX_SIZE - 1); while( s < MAX_SIZE - 1 ) @@ -1479,7 +1478,7 @@ icvFindContoursInInterval( const CvArr* src, cv::Ptr storage01; CvSeq* first = 0; - int i, j, k, n; + int j, k, n; uchar* src_data = 0; int img_step = 0; @@ -1547,7 +1546,6 @@ icvFindContoursInInterval( const CvArr* src, // First line. None of runs is binded tmp.pt.y = 0; - i = 0; CV_WRITE_SEQ_ELEM( tmp, writer ); upper_line = (CvLinkedRunPoint*)CV_GET_WRITTEN_ELEM( writer ); @@ -1580,7 +1578,7 @@ icvFindContoursInInterval( const CvArr* src, last_elem = tmp_prev; tmp_prev->next = 0; - for( i = 1; i < img_size.height; i++ ) + for( int i = 1; i < img_size.height; i++ ) { //------// Find runs in next line src_data += img_step; diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index d58b438a89..0d44e44424 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -338,7 +338,6 @@ LineAA( Mat& img, Point2l pt1, Point2l pt2, const void* color ) if( ax > ay ) { - dx = ax; dy = (dy ^ j) - j; pt1.x ^= pt2.x & j; pt2.x ^= pt1.x & j; @@ -362,7 +361,6 @@ LineAA( Mat& img, Point2l pt1, Point2l pt2, const void* color ) } else { - dy = ay; dx = (dx ^ i) - i; pt1.x ^= pt2.x & i; pt2.x ^= pt1.x & i; @@ -677,7 +675,6 @@ Line2( Mat& img, Point2l pt1, Point2l pt2, const void* color) if( ax > ay ) { - dx = ax; dy = (dy ^ j) - j; pt1.x ^= pt2.x & j; pt2.x ^= pt1.x & j; @@ -692,7 +689,6 @@ Line2( Mat& img, Point2l pt1, Point2l pt2, const void* color) } else { - dy = ay; dx = (dx ^ i) - i; pt1.x ^= pt2.x & i; pt2.x ^= pt1.x & i; diff --git a/modules/imgproc/src/filter.avx2.cpp b/modules/imgproc/src/filter.avx2.cpp index b469329598..e9ced20e36 100644 --- a/modules/imgproc/src/filter.avx2.cpp +++ b/modules/imgproc/src/filter.avx2.cpp @@ -128,8 +128,6 @@ int SymmColumnVec_32f_Symm_AVX(const float** src, const float* ky, float* dst, f for( k = 1; k <= ksize2; k++ ) { f = _mm_set1_ps(ky[k]); - S = src[k] + i; - S2 = src[-k] + i; x0 = _mm_add_ps(_mm_load_ps(src[k]+i), _mm_load_ps(src[-k] + i)); s0 = _mm_add_ps(s0, _mm_mul_ps(x0, f)); } @@ -144,7 +142,7 @@ int SymmColumnVec_32f_Symm_AVX(const float** src, const float* ky, float* dst, f int SymmColumnVec_32f_Unsymm_AVX(const float** src, const float* ky, float* dst, float delta, int width, int ksize2) { int i = 0, k; - const float *S, *S2; + const float *S2; const __m128 d4 = _mm_set1_ps(delta); const __m256 d8 = _mm256_set1_ps(delta); @@ -152,11 +150,10 @@ int SymmColumnVec_32f_Unsymm_AVX(const float** src, const float* ky, float* dst, { __m256 f, s0 = d8, s1 = d8; __m256 x0; - S = src[0] + i; for (k = 1; k <= ksize2; k++) { - S = src[k] + i; + const float *S = src[k] + i; S2 = src[-k] + i; f = _mm256_set1_ps(ky[k]); x0 = _mm256_sub_ps(_mm256_loadu_ps(S), _mm256_loadu_ps(S2)); diff --git a/modules/imgproc/src/floodfill.cpp b/modules/imgproc/src/floodfill.cpp index 953b4bba9e..0509c61267 100644 --- a/modules/imgproc/src/floodfill.cpp +++ b/modules/imgproc/src/floodfill.cpp @@ -467,7 +467,7 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask, if( rect ) *rect = Rect(); - int i, connectivity = flags & 255; + int i; union { uchar b[4]; int i[4]; @@ -491,9 +491,8 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask, CV_Error( CV_StsBadArg, "Number of channels in input image must be 1 or 3" ); } - if( connectivity == 0 ) - connectivity = 4; - else if( connectivity != 4 && connectivity != 8 ) + const int connectivity = flags & 255; + if( connectivity != 0 && connectivity != 4 && connectivity != 8 ) CV_Error( CV_StsBadFlag, "Connectivity must be 4, 0(=4) or 8" ); bool is_simple = mask.empty() && (flags & FLOODFILL_MASK_ONLY) == 0; diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp index f3ddeaf78c..6eb848068b 100644 --- a/modules/imgproc/src/histogram.cpp +++ b/modules/imgproc/src/histogram.cpp @@ -1930,7 +1930,7 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method ) Mat planes[2]; NAryMatIterator it(arrays, planes); double result = 0; - int j, len = (int)it.size; + int j; CV_Assert( H1.type() == H2.type() && H1.depth() == CV_32F ); @@ -1946,7 +1946,7 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method ) { const float* h1 = it.planes[0].ptr(); const float* h2 = it.planes[1].ptr(); - len = it.planes[0].rows*it.planes[0].cols*H1.channels(); + const int len = it.planes[0].rows*it.planes[0].cols*H1.channels(); j = 0; if( (method == CV_COMP_CHISQR) || (method == CV_COMP_CHISQR_ALT)) diff --git a/modules/imgproc/src/hough.cpp b/modules/imgproc/src/hough.cpp index 18c532253f..36f2f6739f 100644 --- a/modules/imgproc/src/hough.cpp +++ b/modules/imgproc/src/hough.cpp @@ -413,7 +413,6 @@ HoughLinesSDiv( InputArray image, OutputArray lines, int type, // Find peaks in maccum... for( index = 0; index < sfn; index++ ) { - i = 0; int pos = (int)(lst.size() - 1); if( pos < 0 || lst[pos].value < mcaccum[index] ) { diff --git a/modules/imgproc/src/min_enclosing_triangle.cpp b/modules/imgproc/src/min_enclosing_triangle.cpp index bb372fe338..4853a755d9 100644 --- a/modules/imgproc/src/min_enclosing_triangle.cpp +++ b/modules/imgproc/src/min_enclosing_triangle.cpp @@ -401,7 +401,6 @@ static void findMinimumAreaEnclosingTriangle(const std::vector &pol a = 1; b = 2; - c = 0; // Main algorithm steps diff --git a/modules/ml/src/ann_mlp.cpp b/modules/ml/src/ann_mlp.cpp index a83c615578..1e4691e69d 100644 --- a/modules/ml/src/ann_mlp.cpp +++ b/modules/ml/src/ann_mlp.cpp @@ -1259,7 +1259,7 @@ public: prev_dEdw_sign[i] = Mat::zeros(weights[i].size(), CV_8S); dEdw[i] = Mat::zeros(weights[i].size(), CV_64F); } - + CV_Assert(total > 0); int dcount0 = max_buf_size/(2*total); dcount0 = std::max( dcount0, 1 ); dcount0 = std::min( dcount0, count ); diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index 9e858add0e..de852abd2e 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -2351,9 +2351,6 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC c->codec_type = AVMEDIA_TYPE_VIDEO; // put sample parameters - unsigned long long lbit_rate = static_cast(bitrate); - lbit_rate += (bitrate / 4); - lbit_rate = std::min(lbit_rate, static_cast(std::numeric_limits::max())); c->bit_rate = bitrate; // took advice from diff --git a/modules/videoio/src/container_avi.cpp b/modules/videoio/src/container_avi.cpp index c2a93698bd..d6a7a059e4 100644 --- a/modules/videoio/src/container_avi.cpp +++ b/modules/videoio/src/container_avi.cpp @@ -325,9 +325,6 @@ bool AVIReadContainer::parseStrl(char stream_id, Codecs codec_) if(m_file_stream && strh.m_four_cc == STRH_CC) { - uint64_t next_strl_list = m_file_stream->tellg(); - next_strl_list += strh.m_size; - AviStreamHeader strm_hdr; *m_file_stream >> strm_hdr;