From b38c32a57380c228813ec59823fd5510ee93ce4c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 17 Jul 2019 14:42:49 +0300 Subject: [PATCH] intel/aub_viewer: fix access to freed memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Windows closed while we're displaying them might lead to invalid memory accessed, so use the safe iterators on the list of windows. Signed-off-by: Lionel Landwerlin Reviewed-by: Tapani Pälli Tested-by: Marge Bot Part-of: --- src/intel/tools/aubinator_viewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/tools/aubinator_viewer.cpp b/src/intel/tools/aubinator_viewer.cpp index 140cde5bbbc..46ab9238ce1 100644 --- a/src/intel/tools/aubinator_viewer.cpp +++ b/src/intel/tools/aubinator_viewer.cpp @@ -1085,7 +1085,7 @@ display_windows(void) window->destroy(window); } - list_for_each_entry(struct window, window, &context.windows, link) { + list_for_each_entry_safe(struct window, window, &context.windows, link) { ImGui::SetNextWindowPos(window->position, ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(window->size, ImGuiCond_FirstUseEver); if (ImGui::Begin(window->name, &window->opened)) { -- 2.30.2