From 4cdfca337506b43749f0ab15ae8e7d8237395fe2 Mon Sep 17 00:00:00 2001 From: Bryan <74067792+Bryan-Roe@users.noreply.github.com> Date: Sat, 11 Jul 2026 00:13:24 -0700 Subject: [PATCH] Potential fix for code scanning alert no. 2257: Multiplication result converted to larger type Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- pxt_modules/screen/image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxt_modules/screen/image.cpp b/pxt_modules/screen/image.cpp index 1fb7b8b54..ec47f1dc6 100644 --- a/pxt_modules/screen/image.cpp +++ b/pxt_modules/screen/image.cpp @@ -502,7 +502,7 @@ void scroll(Image_ img, int dx, int dy) { } else if (dx < 0) { dx = -dx; if (dx < w) - memmove(img->pix(), img->pix(dx, 0), (w - dx) * bh); + memmove(img->pix(), img->pix(dx, 0), static_cast(w - dx) * static_cast(bh)); else dx = w; memset(img->pix(w - dx, 0), 0, dx * bh);