Fix Array Out of Bounds crash if no video tracks present #1413
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was caused by the video track auto selection code assuming there was always a video track group. On audio only files, there is no video group so we get an out of bounds. The code now checks to ensure that group 0 actually exists.
In the multi-track videos I tested, auto-track selection works properly, but I'm not sure if there are any situations where you might have multiple video track groups. I believe this would only happen with an MP4 that has multiple embedded video streams.
Fixes #1408