Fixed overflow check (should never be hit) [skip ci]

This commit is contained in:
Andrew Kane
2026-06-18 12:51:38 -07:00
parent f2617f02d1
commit 6731c49811

View File

@@ -280,7 +280,7 @@ ElkanKmeans(Relation index, VectorArray samples, VectorArray centers, const Ivff
IvfflatCheckMemoryUsage(totalSize);
/* Ensure indexing does not overflow */
if (numCenters * numCenters > INT_MAX)
if (numCenters > INT_MAX / numCenters)
elog(ERROR, "Indexing overflow detected. Please report a bug.");
/* Set support functions */