From 501388d29f0bf77717f727466b80e6be0a8bfbba Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Tue, 18 Feb 2025 20:37:34 +0800 Subject: [PATCH] ENH:Add an array out of bounds protection jira: none Change-Id: I57f401d368191aec8a6687158e0c50c455429893 (cherry picked from commit 4e3ee050db33be341266f8635721c1f92f8ca0f5) --- src/slic3r/GUI/Plater.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f585b2c906..a60b3799dc 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3010,8 +3010,12 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn) } for (size_t i = 0; i < sync_ams_badges.size(); i++) { if (sync_ams_badges[i] == true) { - auto &c = p->combos_filament[i]; - badge_combox_filament(c); + if (i < p->combos_filament.size()) { + auto &c = p->combos_filament[i]; + badge_combox_filament(c); + } else { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << "check error: p->combos_filament array out of bound"; + } } } } else {