From 66f3a3ce555e145bc819c8555fc501f6cae30aa1 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 28 Nov 2011 22:16:58 +0000 Subject: [PATCH] Fix integer overflow in the matroska subtitle loader which resulted in meaningless progress reporting Originally committed to SVN as r5925. --- aegisub/src/mkv_wrap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/mkv_wrap.cpp b/aegisub/src/mkv_wrap.cpp index afba18538..5009a24b1 100644 --- a/aegisub/src/mkv_wrap.cpp +++ b/aegisub/src/mkv_wrap.cpp @@ -119,7 +119,7 @@ static void read_subtitles(agi::ProgressSink *ps, MatroskaFile *file, MkvStdIO * subList[subList.size()] = blockString; } - ps->SetProgress(startTime, totalTime); + ps->SetProgress(startTime / timecodeScaleLow, totalTime); } delete readBuf; @@ -215,7 +215,7 @@ void MatroskaWrapper::GetSubtitles(wxString const& filename, AssFile *target) { longlong timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale; // Progress bar - double totalTime = double(segInfo->Duration) / timecodeScale * 1000000.0; + double totalTime = double(segInfo->Duration) / timecodeScale; DialogProgress progress(NULL, _("Parsing Matroska"), _("Reading subtitles from Matroska file.")); progress.Run(bind(read_subtitles, std::tr1::placeholders::_1, file, &input, srt, ssa, totalTime, target)); }