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

Author: Lionel Landwerlin <[email protected]>
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 <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
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)) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to