1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-27 06:13:05 +04:00
Files
opencv/modules/core/test
Jesus Armando Anaya 7334957476 core(ocl): fix out-of-bounds read and SIGFPE in predictOptimalVectorWidth for new depths
predictOptimalVectorWidth() built its vectorWidths table with 8 entries
(depths CV_8U..CV_16F), but checkOptimalVectorWidth() indexes it by depth.
The 5.x depths CV_16BF, CV_Bool, CV_64U, CV_64S and CV_32U therefore read
past the end of the array; the garbage value can slip past the ckercn <= 0
guard, and the divider normalization loop then shifts the divider to zero,
so "offsets[i] % dividers[i]" raises SIGFPE. The failure is allocation
dependent and shows up as a sequence-dependent crash, e.g. in the OpenCL
Norm tests for CV_32U (cv::norm on a UMat reaches this via ocl_sum, which
calls predictOptimalVectorWidth before its own depth guard bails out).

Size the table to CV_DEPTH_MAX so every depth is in bounds and map the new
fixed-size integer depths to their natural OpenCL vector widths; CV_16BF
has no OpenCL vector type and stays scalar. Add a regression test covering
all depths.
2026-06-21 16:39:40 -07:00
..
2026-05-20 17:57:51 +03:00
2026-02-20 22:05:35 +03:00
2018-02-12 07:09:43 -05:00
2026-05-24 17:28:53 +03:00
2026-02-20 22:05:35 +03:00
2026-05-25 17:49:25 +03:00
2026-05-25 17:49:25 +03:00
2024-08-28 15:06:19 +03:00
2026-03-19 11:29:57 +03:00
2024-01-23 17:06:52 +03:00
2018-02-03 19:39:47 +00:00
2025-11-18 08:51:08 +03:00