diff options
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r-- | win/C#/frmMain.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 3664b319e..349ba98a2 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1442,14 +1442,17 @@ namespace Handbrake int position = start_chapter - 1;
- if (end_chapter > selectedTitle.Chapters.Count)
- end_chapter = selectedTitle.Chapters.Count;
-
- while (position != end_chapter)
+ if (start_chapter <= end_chapter)
{
- TimeSpan dur = selectedTitle.Chapters[position].Duration;
- Duration = Duration + dur;
- position++;
+ if (end_chapter > selectedTitle.Chapters.Count)
+ end_chapter = selectedTitle.Chapters.Count;
+
+ while (position != end_chapter)
+ {
+ TimeSpan dur = selectedTitle.Chapters[position].Duration;
+ Duration = Duration + dur;
+ position++;
+ }
}
}
|