Skip to content

fix: guard BluRay duration parse against short log messages - #783

Open
Bolt4243 wants to merge 1 commit into
mpvnet-player:mainfrom
Bolt4243:fix/bluray-substr-guard
Open

fix: guard BluRay duration parse against short log messages#783
Bolt4243 wants to merge 1 commit into
mpvnet-player:mainfrom
Bolt4243:fix/bluray-substr-guard

Conversation

@Bolt4243

Copy link
Copy Markdown

ProcessBluRayLogMessage in Player.cs calls msg.Substring(start, 2), msg.Substring(start + 3, 2), and msg.Substring(start + 6, 2) unconditionally after finding " duration: ". A truncated or malformed log line where the string ends before start + 8 throws ArgumentOutOfRangeException.

Added a length check (msg.Length >= start + 8) before the Substring calls so malformed lines are silently skipped.

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