From 53c3bb45f8855d0c73196b3906364cbcd5ce51e8 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Mon, 6 Jan 2014 09:41:06 +0100 Subject: [PATCH] Fix an out of bounds array crash. --- MP42/MP42VobSubImporter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP42/MP42VobSubImporter.m b/MP42/MP42VobSubImporter.m index af51c99..5f76336 100644 --- a/MP42/MP42VobSubImporter.m +++ b/MP42/MP42VobSubImporter.m @@ -334,7 +334,7 @@ static NSArray* LoadVobSubSubtitles(NSURL *theDirectory, NSString *filename) uint32_t endTime = currentSample->timeStamp + endTimestamp; int duration = endTimestamp - startTimestamp; - if(duration <= 0 && i <= sampleCount - 1) { + if(duration <= 0 && i < sampleCount - 1) { //Sample with no end duration, use the duration of the next one endTime = ((SBVobSubSample *)[vobTrack->samples objectAtIndex:i+1])->timeStamp; duration = endTime - startTime;