Skip to content

fix: guard minimum-aspect-ratio parsing against FormatException#781

Open
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/aspect-ratio-parse
Open

fix: guard minimum-aspect-ratio parsing against FormatException#781
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/aspect-ratio-parse

Conversation

@Noethix55555

Copy link
Copy Markdown

ProcessProperty in App.cs called value.ToFloat() (which uses float.Parse) for the minimum-aspect-ratio and minimum-aspect-ratio-audio config keys. A malformed value in mpvnet.conf throws a FormatException and crashes startup.

Replace both assignments with float.TryParse, silently ignoring invalid values and leaving the property at its default.

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.

1 participant