From 9038ab8d6538ca329e07e0a61958e62abec1075a Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sun, 29 May 2011 17:10:35 +0200 Subject: [PATCH] Bail out from the loop if we run out of data. --- src/NotesLoaderDWI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NotesLoaderDWI.cpp b/src/NotesLoaderDWI.cpp index a84c59fb1c..9277a7a464 100644 --- a/src/NotesLoaderDWI.cpp +++ b/src/NotesLoaderDWI.cpp @@ -333,6 +333,10 @@ static bool LoadFromDWITokens( if( iCol2 != -1 ) newNoteData.SetTapNote(iCol2, iIndex, TAP_ORIGINAL_TAP); + if(i>=sStepData.length()) { + break;//we ran out of data while looking for the ending > mark + } + if( sStepData[i] == '!' ) { i++;