From 0f1e19319365f1c753735b8e04e58461276f77fd Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 26 Feb 2018 00:16:02 +0300 Subject: [PATCH] Fixed two issues found by static analysis --- modules/dnn/src/layers/pooling_layer.cpp | 2 ++ modules/imgcodecs/src/grfmt_tiff.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp index 3cdc786..1aeba3a 100644 --- a/modules/dnn/src/layers/pooling_layer.cpp +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -323,6 +323,8 @@ public: #if CV_SIMD128 const int* ofsptr = ofsbuf.empty() ? 0 : (const int*)&ofsbuf[0]; + if (poolingType == MAX && !compMaxIdx && !ofsptr) + CV_Error(Error::StsBadArg, "ofsbuf should be initialized in this mode"); v_float32x4 idx00(0.f, (float)stride_w, (float)(stride_w*2), (float)(stride_w*3)); v_float32x4 ones = v_setall_f32(1.f); v_float32x4 idx_delta = v_setall_f32((float)(inp_width - kernel_w)); diff --git a/modules/imgcodecs/src/grfmt_tiff.cpp b/modules/imgcodecs/src/grfmt_tiff.cpp index 372176e..e2aa2bd 100644 --- a/modules/imgcodecs/src/grfmt_tiff.cpp +++ b/modules/imgcodecs/src/grfmt_tiff.cpp @@ -775,6 +775,7 @@ bool TiffEncoder::writeLibTiff( const std::vector& img_vec, const std::vect } default: { + TIFFClose(pTiffHandle); return false; } } -- 2.7.4