Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite loops #2531

Merged
merged 3 commits into from Jan 13, 2020
Merged

Fix infinite loops #2531

merged 3 commits into from Jan 13, 2020

Conversation

lejuyan
Copy link
Contributor

@lejuyan lejuyan commented Jul 12, 2019

  • This change has been discussed with the author.
  • It implements / fixes issue #.

Description:
This commit intends to fix a kind of infinite loops:

If there are files like:
/-test.mp4
|-dir0/a.sub
|-dir1/a.sub
|-dir2/a.sub
|-dir3/a.sub

The tryGroupFiles method would find it self infinitely looping i++ when dealing with these "a.sub" files. And the user may find iina using 100% CPU at this time.

@uiryuu uiryuu requested a review from lhc70000 July 22, 2019 13:31
iina/FileGroup.swift Outdated Show resolved Hide resolved
@lhc70000 lhc70000 merged commit f4cb799 into iina:develop Jan 13, 2020
revolter pushed a commit to revolter/iina that referenced this pull request Apr 25, 2020
* fix infinite loop happening on identical file names.

* fix whitespaces

* better style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants