stream_file: mark fd protocols as "unsafe"

Whatever good or bad that might do. In any case, they can easily trigger
UB-like behavior.
This commit is contained in:
wm4 2020-03-08 18:43:31 +01:00
parent 7170910f4c
commit d0d9ace421
2 changed files with 11 additions and 2 deletions

View File

@ -51,6 +51,7 @@ extern const stream_info_t stream_info_ffmpeg;
extern const stream_info_t stream_info_ffmpeg_unsafe;
extern const stream_info_t stream_info_avdevice;
extern const stream_info_t stream_info_file;
extern const stream_info_t stream_info_fd;
extern const stream_info_t stream_info_ifo_dvdnav;
extern const stream_info_t stream_info_dvdnav;
extern const stream_info_t stream_info_bdmv_dir;
@ -87,6 +88,7 @@ static const stream_info_t *const stream_list[] = {
&stream_info_mf,
&stream_info_edl,
&stream_info_file,
&stream_info_fd,
&stream_info_cb,
NULL
};

View File

@ -351,8 +351,15 @@ static int open_f(stream_t *stream)
const stream_info_t stream_info_file = {
.name = "file",
.open = open_f,
.protocols = (const char*const[]){ "file", "", "fd", "fdclose",
"appending", NULL },
.protocols = (const char*const[]){ "file", "", "appending", NULL },
.can_write = true,
.stream_origin = STREAM_ORIGIN_FS,
};
const stream_info_t stream_info_fd = {
.name = "fd",
.open = open_f,
.protocols = (const char*const[]){ "fd", "fdclose", NULL },
.can_write = true,
.stream_origin = STREAM_ORIGIN_UNSAFE,
};