mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Bug 2282 - Multi-view: Array out of bounds exception (crash)
This commit is contained in:
@@ -573,8 +573,12 @@ void WaveTrackView::ToggleSubView(WaveTrackDisplay display)
|
||||
float total = 0;
|
||||
int greatest = -1;
|
||||
unsigned nn = 0;
|
||||
for ( const auto &placement : mPlacements ) {
|
||||
int removedIndex = foundPlacement.index;
|
||||
for ( auto &placement : mPlacements ) {
|
||||
if ( placement.fraction >= 0.0 && placement.index >= 0 ) {
|
||||
// renumber in case there's an item removed.
|
||||
if( (removedIndex >= 0) && (placement.index >= removedIndex))
|
||||
placement.index -= 1;
|
||||
total += placement.fraction;
|
||||
greatest = std::max( greatest, placement.index );
|
||||
++nn;
|
||||
|
||||
Reference in New Issue
Block a user