From 5c91261ca0ff1b65481c33e9683e4b2e31be5614 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Mon, 30 Mar 2026 10:41:55 +0200 Subject: [PATCH] Force step to be ptrdiff_t in resize Otherwise, ASAN could return an error: "runtime error: addition of unsigned offset" --- modules/core/src/matrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 98d25d909f..bafa80809c 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -1030,7 +1030,7 @@ void Mat::resize(size_t nelems) reserve(nelems); size.p[0] = (int)nelems; - dataend += (size.p[0] - saveRows)*step.p[0]; + dataend += (size.p[0] - saveRows)*(ptrdiff_t)step.p[0]; //updateContinuityFlag(*this); }