mirror of
https://github.com/opencv/opencv.git
synced 2026-12-03 05:33:03 -06:00
DISK, ALIKED and the two LightGlueMatcher variants read the ONNX network outputs through raw pointers and Mat::at<> with the layout of the reference exports, but never check the shape or element type that the loaded model actually returned. Any model passed to DISK::create, ALIKED::create or LightGlueMatcher::create (file or buffer) reaches this code: DISK::detectAndCompute reads kptsData[i * 2 + 1] for every row of keypoints without checking it has 2 columns. ALIKEDImpl::runNetwork reads at<float>(i, 1) on keypoints and at<float>(i, 0) on scores without checking 2 columns or the float type. ALIKEDLightGlueMatcherImpl::lightglueMatch reads at<int64_t>(i, 1) on matches0 and at<float>(i) on mscores0 for every match row without checking 2 columns, the int64 type or one score per match. DISKLightGlueMatcherImpl::lightglueMatch already checks the element counts but reads at<int64_t>(i) on matches0 without checking the int64 type.