fix(tracker): copy MediaPipe segmentation mask (fixes Windows use-after-free crash)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s

This commit is contained in:
kinect-bot committed 2026-11-25 15:07:47 -05:00
1 parent b4397e6151
commit dafd249165
1 file changed
+4 -1
+4 -1
View File
@@ -165,7 +165,10 @@ class MediaPipePoseProvider(PoseProvider):
mask = None
if result.segmentation_masks:
mask = np.ascontiguousarray(result.segmentation_masks[0].numpy_view(), dtype=np.float32)
# numpy_view() aliases MediaPipe-owned memory that is freed on the
# next detect/result release; copy it so the publisher never reads a
# freed buffer (a hard access-violation crash on Windows).
mask = np.array(result.segmentation_masks[0].numpy_view(), dtype=np.float32, copy=True)
if mask.ndim == 3 and mask.shape[-1] == 1:
mask = mask[..., 0]