From 25f8c587dcd1c8cbced54b23c51939834f4da287 Mon Sep 17 00:00:00 2001 From: linxie47 Date: Tue, 17 Dec 2024 20:18:51 +0800 Subject: [PATCH] Fix code scanning alert no. 686: Multiplication result converted to larger type Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- ivsr_sdk/src/smart_patch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivsr_sdk/src/smart_patch.cpp b/ivsr_sdk/src/smart_patch.cpp index 5bc433e..b6a25f4 100644 --- a/ivsr_sdk/src/smart_patch.cpp +++ b/ivsr_sdk/src/smart_patch.cpp @@ -101,7 +101,7 @@ void fill_image(std::vector> patchCorners, char* imgBuf, \ int img_sN = iC * iH * iW; int img_sB = iN * iC * iH * iW; - size_t outputpixels = iB * iN * iC * iH * iW; + size_t outputpixels = static_cast(iB) * iN * iC * iH * iW; int * pixelCounter = new int[outputpixels](); float * img_ptr =(float *)imgBuf;