From: Mikko Rasa Date: Mon, 3 Jun 2013 18:39:25 +0000 (+0300) Subject: Fix a problem with TrackIter::block_iter at end of line X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=51d3c122fb489f9e3f00060f885f00c1fae7ceb5;p=r2c2.git Fix a problem with TrackIter::block_iter at end of line If the track iterator was already on the last track, the check for returning an empty block iterator would not get executed, and the throw at the end of the function would get triggered. --- diff --git a/source/libr2c2/trackiter.cpp b/source/libr2c2/trackiter.cpp index 31ebf08..e07c71c 100644 --- a/source/libr2c2/trackiter.cpp +++ b/source/libr2c2/trackiter.cpp @@ -43,12 +43,12 @@ BlockIter TrackIter::block_iter() const { last = rev; rev = rev.next(); - - // If we ran out of tracks, return an empty iterator - if(!rev) - return BlockIter(); } + // If we ran out of tracks, return an empty iterator + if(!rev) + return BlockIter(); + TrackIter fwd = last.reverse(); for(unsigned i=0; i