Skip to content

Commit

Permalink
Fix some potential null pointer dereferences
Browse files Browse the repository at this point in the history
These two were discovered through clang's scan-build. I don't know
if they can be triggered in the real world since they do appear to
rely on certain GUI states which a human may not be able to trigger.
  • Loading branch information
CounterPillow authored and mikesart committed Dec 2, 2018
1 parent fa3ddcc commit 9e4b737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gpuvis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4287,7 +4287,7 @@ void MainApp::render_color_picker()
{
changed |= render_color_picker_colors( m_colorpicker, m_colorpicker_color );
}
else if ( !m_colorpicker_event.empty() )
else if ( !m_colorpicker_event.empty() && win )
{
changed |= render_color_picker_event_colors( m_colorpicker,
win, m_colorpicker_event );
Expand All @@ -4309,7 +4309,7 @@ void MainApp::render_color_picker()

s_textclrs().update_colors();
}
else if ( !m_colorpicker_event.empty() )
else if ( !m_colorpicker_event.empty() && win )
{
win->m_trace_events.set_event_color( m_colorpicker_event, m_colorpicker.m_color );
}
Expand Down

0 comments on commit 9e4b737

Please sign in to comment.