1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Deprecated convertTypeStr and made new variant that also takes the buffer size

This allows removing the unsafe sprintf.
This commit is contained in:
Sean McBride
2022-12-26 19:00:03 -05:00
parent e3e1f704a4
commit 58e4a880a2
25 changed files with 92 additions and 85 deletions
+2 -2
View File
@@ -1263,8 +1263,8 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
ocl::Kernel k("convertTo", ocl::core::convert_oclsrc,
format("-D srcT=%s -D WT=%s -D dstT=%s -D convertToWT=%s -D convertToDT=%s%s%s",
ocl::typeToStr(sdepth), ocl::typeToStr(wdepth), ocl::typeToStr(ddepth),
ocl::convertTypeStr(sdepth, wdepth, 1, cvt[0]),
ocl::convertTypeStr(wdepth, ddepth, 1, cvt[1]),
ocl::convertTypeStr(sdepth, wdepth, 1, cvt[0], sizeof(cvt[0])),
ocl::convertTypeStr(wdepth, ddepth, 1, cvt[1], sizeof(cvt[1])),
doubleSupport ? " -D DOUBLE_SUPPORT" : "", noScale ? " -D NO_SCALE" : ""));
if (!k.empty())
{