Skip to content

Commit 1033f2b

Browse files
committed
Fixed 3 issues found by static analysis
1 parent 62359f7 commit 1033f2b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

modules/dnn/src/dnn.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ struct Net::Impl
655655
fusion = true;
656656
preferableBackend = DNN_BACKEND_DEFAULT;
657657
preferableTarget = DNN_TARGET_CPU;
658+
blobManager.setPreferableBackend(DNN_BACKEND_DEFAULT);
659+
blobManager.setPreferableTarget(DNN_TARGET_CPU);
658660
}
659661

660662
Ptr<DataLayer> netInputLayer;

modules/dnn/src/layers/convolution_layer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ class ConvolutionLayerImpl : public BaseConvolutionLayerImpl
783783
if( IS_POWER_LAYER(activ) )
784784
{
785785
Ptr<PowerLayer> activ_power = activ.dynamicCast<PowerLayer>();
786+
CV_Assert(activ_power);
786787
a = activ_power->scale;
787788
b = activ_power->shift;
788789
}

modules/imgproc/src/smooth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,7 @@ static bool ocl_GaussianBlur_8UC1(InputArray _src, OutputArray _dst, Size ksize,
18441844

18451845
const char * const borderMap[] = { "BORDER_CONSTANT", "BORDER_REPLICATE", "BORDER_REFLECT", 0, "BORDER_REFLECT_101" };
18461846
char build_opts[1024];
1847-
sprintf(build_opts, "-D %s %s%s", borderMap[borderType],
1847+
sprintf(build_opts, "-D %s %s%s", borderMap[borderType & ~BORDER_ISOLATED],
18481848
ocl::kernelToStr(kernelX, CV_32F, "KERNEL_MATRIX_X").c_str(),
18491849
ocl::kernelToStr(kernelY, CV_32F, "KERNEL_MATRIX_Y").c_str());
18501850

0 commit comments

Comments
 (0)