1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

Revert "Bug 2282 - Multi-view: Array out of bounds exception (crash)"

This reverts commit e047c07a90e25eaee775922ee3b963f154c3ea76.
This commit is contained in:
Paul Licameli 2020-01-09 14:15:38 -05:00
parent da2f5491ae
commit d01c24d4d6

View File

@ -573,12 +573,8 @@ void WaveTrackView::ToggleSubView(WaveTrackDisplay display)
float total = 0;
int greatest = -1;
unsigned nn = 0;
int removedIndex = foundPlacement.index;
for ( auto &placement : mPlacements ) {
for ( const 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;