1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

core: verify length check from vector to InputArray

This commit is contained in:
Kumataro
2025-09-23 19:46:08 +09:00
parent 691b1bdc05
commit 6dbf7612f9
3 changed files with 21 additions and 1 deletions
@@ -619,4 +619,13 @@ TEST(Imgcodecs_Params, imencode_regression_22752)
EXPECT_ANY_THROW(cv::imencode("test.jpg", img, buf, params)); // parameters size or missing JPEG codec
}
TEST(Imgcodecs, decode_over2GB)
{
applyTestTag(CV_TEST_TAG_MEMORY_6GB);
// empty buffer more than 2GB size
std::vector<uint8_t> buf(size_t(INT_MAX) + 4096);
cv::Mat dst;
EXPECT_THROW(dst = cv::imdecode(buf, cv::IMREAD_COLOR), cv::Exception);
}
}} // namespace