Skip to content

fix(command): avoid command-string injection in show-text and out-of-range in cycle-audio#774

Open
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/command-string-and-cycleaudio
Open

fix(command): avoid command-string injection in show-text and out-of-range in cycle-audio#774
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/command-string-and-cycleaudio

Conversation

@Noethix55555

Copy link
Copy Markdown

Two fixes in Command.cs:

ShowText injection: ShowText built a raw mpv_command_string by concatenating the caller-supplied text directly. A double-quote in a media track title (e.g. He said hello) breaks the command. Fix: use Player.CommandV(show-text, ...) so each argument is a separate C string with no shell quoting needed.

CycleAudio out-of-range: CycleAudio always called tracks[aid - 1], but aid can be 0 when audio is disabled, or can exceed tracks.Length when external audio files have non-contiguous track IDs. Either case throws IndexOutOfRangeException. Fix: guard with if (aid < 1 || aid > tracks.Length) return before indexing.

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