1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +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
+1 -1
View File
@@ -1235,7 +1235,7 @@ static bool ocl_calcHist1(InputArray _src, OutputArray _hist, int ddepth = CV_32
char cvt[50];
ocl::Kernel k2("merge_histogram", ocl::imgproc::histogram_oclsrc,
format("-D BINS=%d -D HISTS_COUNT=%d -D WGS=%d -D convertToHT=%s -D HT=%s",
BINS, compunits, (int)wgs, ocl::convertTypeStr(CV_32S, ddepth, 1, cvt),
BINS, compunits, (int)wgs, ocl::convertTypeStr(CV_32S, ddepth, 1, cvt, sizeof(cvt)),
ocl::typeToStr(ddepth)));
if (k2.empty())
return false;