Fix an out of bounds array crash.

This commit is contained in:
Damiano Galassi committed 2014-01-06 09:41:06 +01:00
1 parent 9099208b9f
commit 53c3bb45f8
1 file changed
+1 -1
+1 -1
View File
@@ -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;