]> git.tdb.fi Git - r2c2.git/commitdiff
Fix a crash when reversing certain TrackOffsetIters
authorMikko Rasa <tdb@tdb.fi>
Fri, 9 Aug 2013 10:31:28 +0000 (13:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 9 Aug 2013 10:31:28 +0000 (13:31 +0300)
source/libr2c2/trackoffsetiter.cpp

index d23b4d7e44813aa5727604b7df465a2974242a86..01fd58042b0b5cf916551913994992671656e7d0 100644 (file)
@@ -118,6 +118,9 @@ TrackOffsetIter TrackOffsetIter::reverse() const
 
        int p = (_path>=0 ? _path : _track->get_active_path());
        TrackIter t = _track.reverse(p);
+       if(!t)
+               return TrackOffsetIter();
+
        float o = t->get_type().get_path_length(p)-_offset;
 
        return TrackOffsetIter(t, p, o);