From dd8083e0ee7d1e8bac21e88cd1fdcb279b4bb31a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 19 Nov 2021 20:58:09 +0100 Subject: [PATCH] Prevent out-of-bounds access. This fixes the issue when assembly view is scrolled to the bottom of the screen and display scale is reduced by the user. In such case clipper will report DisplayStart to be at the end element, which would cause out-of-bounds access to the m_asm array. Clipper self-fixes this in the next frame, so this workaround is enough. --- server/TracySourceView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 757188f4..17ee22ec 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -2226,7 +2226,7 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker insList.emplace_back( line.addr ); } } - if( m_showJumps && !m_jumpTable.empty() ) + if( m_showJumps && !m_jumpTable.empty() && clipper.DisplayStart != clipper.DisplayEnd ) { auto draw = ImGui::GetWindowDrawList(); const auto ts = ImGui::CalcTextSize( " " );