mirror of
https://github.com/opencv/opencv.git
synced 2026-09-26 04:09:43 +03:00
The minMaxIdx dispatch table in modules/core/src/minmax.cpp stored seven differently typed functions through C-style casts to a single MinMaxIdxFunc pointer type, which is undefined behaviour and trips UBSan's -fsanitize=function for any CV_32F or CV_64F input. This change switches the typedef and every depth-specific helper to take void pointers for src, minval and maxval, with the original typed pointer recovered at function entry. The dispatch table no longer needs C-style casts and the int pointer punning at the call site goes away. Fixes #28928.