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
2ab5002e
Commit
2ab5002e
authored
Aug 03, 2015
by
Hendrik Leppkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: avoid scanf in keyboard command parsing
Mixing stdio and low-level IO on stdin is not safe.
parent
3c865220
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
ffmpeg.c
ffmpeg.c
+10
-2
No files found.
ffmpeg.c
View file @
2ab5002e
...
...
@@ -3428,9 +3428,17 @@ static int check_keyboard_interaction(int64_t cur_time)
if
(
!
debug
)
debug
=
1
;
while
(
debug
&
(
FF_DEBUG_DCT_COEFF
|
FF_DEBUG_VIS_QP
|
FF_DEBUG_VIS_MB_TYPE
))
//unsupported, would just crash
debug
+=
debug
;
}
else
if
(
scanf
(
"%d"
,
&
debug
)
!=
1
)
}
else
{
char
buf
[
32
];
int
k
=
0
;
i
=
0
;
while
((
k
=
read_key
())
!=
'\n'
&&
k
!=
'\r'
&&
i
<
sizeof
(
buf
)
-
1
)
if
(
k
>
0
)
buf
[
i
++
]
=
k
;
buf
[
i
]
=
0
;
if
(
k
<=
0
||
sscanf
(
buf
,
"%d"
,
&
debug
)
!=
1
)
fprintf
(
stderr
,
"error parsing debug value
\n
"
);
}
for
(
i
=
0
;
i
<
nb_input_streams
;
i
++
)
{
input_streams
[
i
]
->
st
->
codec
->
debug
=
debug
;
}
...
...
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