diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-04 21:43:45 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-04 21:43:45 +0000 |
| commit | 15e9cb7324f1b331acde37d30590ba42c032eff2 (patch) | |
| tree | e4b303f9e70c4bf78be6e0c2f21d1ba04d71cae3 /src | |
| parent | 606b0a89db11cbbf81c24f805559be8af4ccb990 (diff) | |
Fix crash in audio mapping view in various circumstances.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/audio_mapping_view.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index 27094d3b2..ef37e1b7a 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -269,8 +269,12 @@ AudioMappingView::paint_row_lines (wxGraphicsContext* gc) void AudioMappingView::paint_indicators (wxDC& dc) { - for (size_t x = 0; x < _output_channels.size(); ++x) { - for (size_t y = 0; y < _input_channels.size(); ++y) { + /* _{input,output}_channels and _map may not always be in sync, be careful here */ + size_t const output = min(_output_channels.size(), _map.output_channels()); + size_t const input = min(_input_channels.size(), _map.input_channels()); + + for (size_t x = 0; x < output; ++x) { + for (size_t y = 0; y < input; ++y) { dc.SetBrush (*wxWHITE_BRUSH); dc.DrawRectangle ( wxRect( |
