@@ -2708,15 +2708,17 @@ struct CreatePointerTables {
27082708 // create pointer table
27092709 int currentIDXforCheck = 0 ;
27102710 int listSize = trackGIForTrackQAIndexList.size ();
2711+ bool breakOnOverflow = false ;
27112712
27122713 for (const auto & track : tracks) {
2713- while (track.globalIndex () > trackGIForTrackQAIndexList[currentIDXforCheck][0 ]) {
2714+ while (!breakOnOverflow && track.globalIndex () > trackGIForTrackQAIndexList[currentIDXforCheck][0 ]) {
27142715 currentIDXforCheck++; // increment the currentIDXforCheck for missing or invalid cases e.g. value = -1;
27152716 if (currentIDXforCheck >= listSize) {
2717+ breakOnOverflow = true ;
27162718 break ;
27172719 }
27182720 }
2719- if (track.globalIndex () == trackGIForTrackQAIndexList[currentIDXforCheck][0 ]) {
2721+ if (!breakOnOverflow && track.globalIndex () == trackGIForTrackQAIndexList[currentIDXforCheck][0 ]) {
27202722 genTrackToTracksQA (trackGIForTrackQAIndexList[currentIDXforCheck][1 ]);
27212723 } else {
27222724 genTrackToTracksQA (-1 ); // put a dummy index when track is not found in trackQA
@@ -2741,15 +2743,17 @@ struct CreatePointerTables {
27412743 // create pointer table
27422744 int currentIDXforCheck = 0 ;
27432745 int listSize = trackGIForTMOIndexList.size ();
2746+ bool breakOnOverflow = false ;
27442747
27452748 for (const auto & track : tracks) {
2746- while (track.globalIndex () > trackGIForTMOIndexList[currentIDXforCheck][0 ]) {
2749+ while (!breakOnOverflow && track.globalIndex () > trackGIForTMOIndexList[currentIDXforCheck][0 ]) {
27472750 currentIDXforCheck++; // increment the currentIDXforCheck for missing or invalid cases e.g. value = -1;
27482751 if (currentIDXforCheck >= listSize) {
2752+ breakOnOverflow = true ;
27492753 break ;
27502754 }
27512755 }
2752- if (track.globalIndex () == trackGIForTMOIndexList[currentIDXforCheck][0 ]) {
2756+ if (!breakOnOverflow && track.globalIndex () == trackGIForTMOIndexList[currentIDXforCheck][0 ]) {
27532757 genTrackToTmo (trackGIForTMOIndexList[currentIDXforCheck][1 ]);
27542758 } else {
27552759 genTrackToTmo (-1 ); // put a dummy index when track is not found in trackQA
0 commit comments