From 4e3ee050db33be341266f8635721c1f92f8ca0f5 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 --- 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 6be73af82..2011a630c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3137,8 +3137,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 {