From 51d3c122fb489f9e3f00060f885f00c1fae7ceb5 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 3 Jun 2013 21:39:25 +0300 Subject: [PATCH] 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. --- source/libr2c2/trackiter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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