whisper.cpp
whisper.cpp copied to clipboard
Lack of escaping in wts output
I noticed a few escaping issues:
- The input name is just piped raw into the output.
https://github.com/ggerganov/whisper.cpp/blob/ac521a566ea6a79ba968c30101140db9f65d187b/examples/main/main.cpp#L342
- Likewise for the output file.
https://github.com/ggerganov/whisper.cpp/blob/ac521a566ea6a79ba968c30101140db9f65d187b/examples/main/main.cpp#L425
The font, by contrast, is wrapped in quotes.
https://github.com/ggerganov/whisper.cpp/blob/ac521a566ea6a79ba968c30101140db9f65d187b/examples/main/main.cpp#L360
I'm unfamiliar with handling user input in c++; I'd expect that fonts are ok to quote like this, but filenames should have some proper escaping (not least because user input is being piped directly into a shell script, that users are encouraged to source, never mind run).
As an aside, would it be possible to add \-escaped newlines to the generated text, too?
I don't anticipate using wts, myself, so I might not be the best person to check whether any changes are appropriate.
Great tool, btw.