From d92efd1f542b828966a3f3309364950619694327 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 10 Sep 2008 20:52:51 +0000 Subject: [PATCH] Work around bug #772, v1 timecodes files with overlapping or out of order ranges caused weird behaviour. Now those files are simply rejected. Originally committed to SVN as r2339. --- aegisub/vfr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aegisub/vfr.cpp b/aegisub/vfr.cpp index 5ea76283f..591102324 100644 --- a/aegisub/vfr.cpp +++ b/aegisub/vfr.cpp @@ -151,6 +151,9 @@ void FrameRate::Load(wxString filename) { if (!temp.ToDouble(&lfps) || lfps <= 0) throw _T("Timecode parsing error, invalid fps format found"); + if (lstart <= lposition) + throw _T("Timecode parsing error, out of order or overlapping timecode range found"); + for (int i = 0; i <= lstart - lposition - 2; i++) AddFrame((int)(floor(currenttime+(i*1000) / AverageFrameRate)));