From: Mikko Rasa Date: Fri, 9 Aug 2013 10:31:28 +0000 (+0300) Subject: Fix a crash when reversing certain TrackOffsetIters X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2314cc760b726c5aa0e697c82f3a9051784e0706;p=r2c2.git Fix a crash when reversing certain TrackOffsetIters --- diff --git a/source/libr2c2/trackoffsetiter.cpp b/source/libr2c2/trackoffsetiter.cpp index d23b4d7..01fd580 100644 --- a/source/libr2c2/trackoffsetiter.cpp +++ b/source/libr2c2/trackoffsetiter.cpp @@ -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);