mpv/player
nanahi 9a861c930b image_writer: fix TOCTOU in screenshot filename generation
The screenshot command is documented to not overwrite existing files.
However, there is a race window between the filename is generated with
gen_fname and when the file is open to write. Specifically, the
convert_image function in this window can be very time consuming
depending on video and screenshot image format and size. This results
in existing file being overwritten because the file writing functions
don't check for the existance of file.

Fix this be opening the file in exclusive mode. Add overwrite parameter to
write_image for other operations that are documented to overwrite existing
files, like screenshot-to-file. Note that for write_avif, checking
existance is used instead because avio_open does not support exclusive
open mode.
2024-03-19 19:30:27 +01:00
..
javascript js: complex key-binding: send also key_text 2024-02-09 16:54:57 +02:00
lua osc: add missing window controls for --title-bar=no 2024-03-18 02:22:28 +00:00
audio.c player/video: subtract frame_time from delay when ao_chain starts audio 2024-03-03 16:24:28 -06:00
client.c various: fix -Wold-style-declaration warning 2024-03-19 08:58:18 +01:00
client.h
command.c demux: add a format-name property 2024-03-17 14:59:40 +00:00
command.h various: add missing include in header flles 2023-09-21 14:40:11 +00:00
configfiles.c player: fix watch later config comments when ignoring path 2024-02-24 05:26:48 +00:00
core.h Revert "player: reset av state on speed changes" 2024-03-03 16:27:59 -06:00
external_files.c command: restore lang after track reload 2024-01-20 17:26:45 +00:00
external_files.h command: restore lang after track reload 2024-01-20 17:26:45 +00:00
javascript.c scripting: rename backend names for concise naming 2023-10-27 23:18:56 +00:00
loadfile.c player/loadfile: rewrite sub autoselection logic 2024-02-24 05:26:37 +00:00
lua.c scripting: add mp.input 2024-01-13 02:53:08 +00:00
main.c osdep/mac: make mac naming of files, folders and function consistent 2024-02-28 15:52:47 +01:00
meson.build meson: generate .com in the same place as the .exe if possible 2023-11-27 18:42:19 +00:00
misc.c player: change insert_next to insert_at 2024-02-26 02:03:21 +00:00
osd.c player: remove --term-remaining-playtime option 2024-01-20 23:24:48 +00:00
playloop.c player/sub: avoid wasteful subtitle redraws 2024-02-15 16:43:11 +00:00
screenshot.c image_writer: fix TOCTOU in screenshot filename generation 2024-03-19 19:30:27 +01:00
screenshot.h
scripting.c mp_thread: prefer tracking threads with id 2023-11-05 17:36:17 +00:00
sub.c player/sub: avoid wasteful subtitle redraws 2024-02-15 16:43:11 +00:00
video.c mp_image: add mp_image_params_static_equal for finer comparision 2024-03-09 05:58:52 +00:00