Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
acc9684d
Commit
acc9684d
authored
Aug 26, 2018
by
Gyan Doshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: block output == input for files
Fixes #4655
parent
5109c381
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
ffmpeg_opt.c
fftools/ffmpeg_opt.c
+15
-1
No files found.
fftools/ffmpeg_opt.c
View file @
acc9684d
...
...
@@ -900,13 +900,14 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
static
void
assert_file_overwrite
(
const
char
*
filename
)
{
const
char
*
proto_name
=
avio_find_protocol_name
(
filename
);
if
(
file_overwrite
&&
no_file_overwrite
)
{
fprintf
(
stderr
,
"Error, both -y and -n supplied. Exiting.
\n
"
);
exit_program
(
1
);
}
if
(
!
file_overwrite
)
{
const
char
*
proto_name
=
avio_find_protocol_name
(
filename
);
if
(
proto_name
&&
!
strcmp
(
proto_name
,
"file"
)
&&
avio_check
(
filename
,
0
)
==
0
)
{
if
(
stdin_interaction
&&
!
no_file_overwrite
)
{
fprintf
(
stderr
,
"File '%s' already exists. Overwrite ? [y/N] "
,
filename
);
...
...
@@ -925,6 +926,19 @@ static void assert_file_overwrite(const char *filename)
}
}
}
if
(
proto_name
&&
!
strcmp
(
proto_name
,
"file"
))
{
for
(
int
i
=
0
;
i
<
nb_input_files
;
i
++
)
{
InputFile
*
file
=
input_files
[
i
];
if
(
file
->
ctx
->
iformat
->
flags
&
AVFMT_NOFILE
)
continue
;
if
(
!
strcmp
(
filename
,
file
->
ctx
->
url
))
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Output %s same as Input #%d - exiting
\n
"
,
filename
,
i
);
av_log
(
NULL
,
AV_LOG_WARNING
,
"FFmpeg cannot edit existing files in-place.
\n
"
);
exit_program
(
1
);
}
}
}
}
static
void
dump_attachment
(
AVStream
*
st
,
const
char
*
filename
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment