Fix integer overflow in the matroska subtitle loader which resulted in meaningless progress reporting

Originally committed to SVN as r5925.
This commit is contained in:
Thomas Goyne 2011-11-28 22:16:58 +00:00
parent cce9cb3c47
commit 66f3a3ce55
1 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ static void read_subtitles(agi::ProgressSink *ps, MatroskaFile *file, MkvStdIO *
subList[subList.size()] = blockString; subList[subList.size()] = blockString;
} }
ps->SetProgress(startTime, totalTime); ps->SetProgress(startTime / timecodeScaleLow, totalTime);
} }
delete readBuf; delete readBuf;
@ -215,7 +215,7 @@ void MatroskaWrapper::GetSubtitles(wxString const& filename, AssFile *target) {
longlong timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale; longlong timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale;
// Progress bar // 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.")); 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)); progress.Run(bind(read_subtitles, std::tr1::placeholders::_1, file, &input, srt, ssa, totalTime, target));
} }