1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

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.
This commit is contained in:
Bartosz Taudul 2021-11-19 20:58:09 +01:00
parent c23abca979
commit dd8083e0ee
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -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( " " );