Mesa (master): intel/aub_viewer: fix access to freed memory

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 3 12:57:42 UTC 2020


Module: Mesa
Branch: master
Commit: b38c32a57380c228813ec59823fd5510ee93ce4c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b38c32a57380c228813ec59823fd5510ee93ce4c

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Wed Jul 17 14:42:49 2019 +0300

intel/aub_viewer: fix access to freed memory

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 <lionel.g.landwerlin at intel.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4430>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4430>

---

 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)) {



More information about the mesa-commit mailing list