Repository navigation
Closed
Description
Problem Description
When I try to import chapters from a file and the file contains more chapters than the original video, HandBrake displays a warning, but if I click Yes, HandBrake displays an Unknown Error instead of importing only a part of the file
Here, the original video has 24 chapters, but I import chapter names from a file, that contains 25 chapters. I get the warning:

But if I click Yes, the importing crashes and no chapter names are imported:

Activity Log, Crash Log or any other details
An Unknown Error has occurred.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.get_Item(Int32 index)
at HandBrakeWPF.ViewModels.ChaptersViewModel.ValidateImportedChapters(Dictionary`2 importedChapters, String& validationErrorMessage, Boolean hasTimestamps)
at HandBrakeWPF.ViewModels.ChaptersViewModel.Import()
at InvokeStub_ChaptersViewModel.Import(Object, Object, IntPtr*)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at HandBrakeWPF.Commands.RelayCommand.Execute(Object parameter)
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
What Operating System are you running?
Windows 10
What version of HandBrake are you running?
1.9.0
Where did you download HandBrake from?
handbrake.fr
Activity
github-actions commentedon Dec 27, 2024
Hello,
Welcome to the HandBrake repository.
Warning
Please be cautious of any non-members suggesting that you download a "DLL" or any other files from 3rd party websites.
These are likely malicious!
Members of the HandBrake team can be identified by the "(Member)" label in the top right of any response from them.
Tip
For HandBrake documentation, please see https://handbrake.fr/docs
Thank You,
The HandBrake Bot
WinGui: Don't crash if we have a chapters mis-match when importing. F…
WinGui: Don't crash if we have a chapters mis-match when importing. F…