diff --git a/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp b/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp index 7cf804f899..baff4512b8 100644 --- a/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp +++ b/Source/Core/DolphinQt/FIFO/FIFOAnalyzer.cpp @@ -161,8 +161,12 @@ void FIFOAnalyzer::UpdateTree() void FIFOAnalyzer::UpdateDetails() { - m_detail_list->clear(); + // Clearing the detail list can update the selection, which causes UpdateDescription to be called + // immediately. However, the object data offsets have not been recalculated yet, which can cause + // the wrong data to be used, potentially leading to out of bounds data or other bad things. + // Clear m_object_data_offsets first, so that UpdateDescription exits immediately. m_object_data_offsets.clear(); + m_detail_list->clear(); if (!FifoPlayer::GetInstance().IsPlaying()) return; @@ -472,7 +476,7 @@ void FIFOAnalyzer::UpdateDescription() auto items = m_tree_widget->selectedItems(); - if (items.isEmpty()) + if (items.isEmpty() || m_object_data_offsets.empty()) return; int frame_nr = items[0]->data(0, FRAME_ROLE).toInt();