Skip to content

Commit

Permalink
[#59] TrackEditor: Improvements and bugfixes (Part 68: Fixed inspecti…
Browse files Browse the repository at this point in the history
…on windows buffer overrun for Mark Ogden's decoder)
  • Loading branch information
tomas-nestorovic committed Jan 24, 2022
1 parent d66373d commit cd2e687
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Main/src/Image_TrackEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,14 +775,14 @@
CImage::CTrackReader tr=rte.tr;
const auto resetProfile=tr.CreateResetProfile();
tr.SetCurrentTimeAndProfile( 0, resetProfile );
const auto nIwsMax=tr.GetTotalTime()/resetProfile.iwTimeMin+2;
const TLogTime iwTimeDefaultHalf=resetProfile.iwTimeDefault/2;
const auto nIwsMax=tr.GetTotalTime()/iwTimeDefaultHalf; // "resetProfile.iwTimeMin" not used to account for decoder phase adjustment, allowing for returning back in time
if (auto iwList=Utils::MakeCallocPtr<TInspectionWindow>(nIwsMax)){
TInspectionWindow *p=iwList;
p++->tEnd=0; // beginning of the very first inspection window
TLogTime tOne; // LogicalTime of recording that resulted in recognition of logical "1"
BYTE iwStatuses=0; // last 8 InspectionWindows statuses (0 = ok, 1 = bad)
BYTE nextIndexPulse=0;
const TLogTime iwTimeDefaultHalf=tr.GetCurrentProfile().iwTimeDefault/2;
for( pAction->SetProgressTarget(tr.GetTotalTime()); tr; pAction->UpdateProgress(p++->tEnd=tr.GetCurrentTime()+iwTimeDefaultHalf) )
if (pAction->IsCancelled())
return ERROR_CANCELLED;
Expand Down

0 comments on commit cd2e687

Please sign in to comment.