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
2fc8ea24
Commit
2fc8ea24
authored
Jan 12, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dissallow sprintf
Originally committed as revision 3823 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0ecca7a4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
13 deletions
+16
-13
ffmpeg.c
ffmpeg.c
+1
-1
apiexample.c
libavcodec/apiexample.c
+6
-5
common.h
libavcodec/common.h
+1
-0
huffyuv.c
libavcodec/huffyuv.c
+3
-2
imgresample.c
libavcodec/imgresample.c
+1
-1
mpegaudiodec.c
libavcodec/mpegaudiodec.c
+1
-1
ratecontrol.c
libavcodec/ratecontrol.c
+1
-1
utils.c
libavcodec/utils.c
+1
-1
udp.c
libavformat/udp.c
+1
-1
No files found.
ffmpeg.c
View file @
2fc8ea24
...
...
@@ -949,7 +949,7 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
if
(
!
fvstats
)
{
today2
=
time
(
NULL
);
today
=
localtime
(
&
today2
);
s
printf
(
filename
,
"vstats_%02d%02d%02d.log"
,
today
->
tm_hour
,
s
nprintf
(
filename
,
sizeof
(
filename
)
,
"vstats_%02d%02d%02d.log"
,
today
->
tm_hour
,
today
->
tm_min
,
today
->
tm_sec
);
fvstats
=
fopen
(
filename
,
"w"
);
...
...
libavcodec/apiexample.c
View file @
2fc8ea24
...
...
@@ -415,7 +415,8 @@ int options_example(int argc, char* argv[])
AVCodec
*
codec
=
avcodec_find_encoder_by_name
((
argc
>
1
)
?
argv
[
2
]
:
"mpeg4"
);
const
AVOption
*
c
;
AVCodecContext
*
avctx
;
char
*
def
=
av_malloc
(
5000
);
#define DEF_SIZE 5000
char
*
def
=
av_malloc
(
DEF_SIZE
);
const
char
*
col
=
""
;
int
i
=
0
;
...
...
@@ -449,16 +450,16 @@ int options_example(int argc, char* argv[])
"unknown??"
,
c
->
name
);
switch
(
t
)
{
case
FF_OPT_TYPE_BOOL
:
i
+=
s
printf
(
def
+
i
,
"%s%s=%s"
,
i
+=
s
nprintf
(
def
+
i
,
DEF_SIZE
-
i
,
"%s%s=%s"
,
col
,
c
->
name
,
c
->
defval
!=
0
.
?
"on"
:
"off"
);
break
;
case
FF_OPT_TYPE_DOUBLE
:
i
+=
s
printf
(
def
+
i
,
"%s%s=%f"
,
i
+=
s
nprintf
(
def
+
i
,
DEF_SIZE
-
i
,
"%s%s=%f"
,
col
,
c
->
name
,
c
->
defval
);
break
;
case
FF_OPT_TYPE_INT
:
i
+=
s
printf
(
def
+
i
,
"%s%s=%d"
,
i
+=
s
nprintf
(
def
+
i
,
DEF_SIZE
-
i
,
"%s%s=%d"
,
col
,
c
->
name
,
(
int
)
c
->
defval
);
break
;
case
FF_OPT_TYPE_STRING
:
...
...
@@ -467,7 +468,7 @@ int options_example(int argc, char* argv[])
char
*
f
=
strchr
(
d
,
','
);
if
(
f
)
*
f
=
0
;
i
+=
s
printf
(
def
+
i
,
"%s%s=%s"
,
i
+=
s
nprintf
(
def
+
i
,
DEF_SIZE
-
i
,
"%s%s=%s"
,
col
,
c
->
name
,
d
);
av_free
(
d
);
}
...
...
libavcodec/common.h
View file @
2fc8ea24
...
...
@@ -499,6 +499,7 @@ tend= rdtsc();\
#define time time_is_forbidden_due_to_security_issues
#define rand rand_is_forbidden_due_to_state_trashing
#define srand srand_is_forbidden_due_to_state_trashing
#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf
#if !(defined(LIBAVFORMAT_BUILD) || defined(_FRAMEHOOK_H))
#define printf please_use_av_log
#define fprintf please_use_av_log
...
...
libavcodec/huffyuv.c
View file @
2fc8ea24
...
...
@@ -1170,13 +1170,14 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
if
((
s
->
flags
&
CODEC_FLAG_PASS1
)
&&
(
s
->
picture_number
&
31
)
==
0
){
int
j
;
char
*
p
=
avctx
->
stats_out
;
char
*
end
=
p
+
1024
*
30
;
for
(
i
=
0
;
i
<
3
;
i
++
){
for
(
j
=
0
;
j
<
256
;
j
++
){
s
printf
(
p
,
"%llu "
,
s
->
stats
[
i
][
j
]);
s
nprintf
(
p
,
end
-
p
,
"%llu "
,
s
->
stats
[
i
][
j
]);
p
+=
strlen
(
p
);
s
->
stats
[
i
][
j
]
=
0
;
}
s
printf
(
p
,
"
\n
"
);
s
nprintf
(
p
,
end
-
p
,
"
\n
"
);
p
++
;
}
}
else
{
...
...
libavcodec/imgresample.c
View file @
2fc8ea24
...
...
@@ -730,7 +730,7 @@ int main(int argc, char **argv)
img
+
50
*
XSIZE
,
XSIZE
,
XSIZE
,
YSIZE
-
100
);
img_resample_close
(
s
);
s
printf
(
buf
,
"/tmp/out%d.pgm"
,
i
);
s
nprintf
(
buf
,
sizeof
(
buf
)
,
"/tmp/out%d.pgm"
,
i
);
save_pgm
(
buf
,
img1
,
xsize
,
ysize
);
}
...
...
libavcodec/mpegaudiodec.c
View file @
2fc8ea24
...
...
@@ -2130,7 +2130,7 @@ void sample_dump(int fnum, int32_t *tab, int n)
f
=
files
[
fnum
];
if
(
!
f
)
{
s
printf
(
buf
,
"/tmp/out%d.%s.pcm"
,
s
nprintf
(
buf
,
sizeof
(
buf
)
,
"/tmp/out%d.%s.pcm"
,
fnum
,
#ifdef USE_HIGHPRECISION
"hp"
...
...
libavcodec/ratecontrol.c
View file @
2fc8ea24
...
...
@@ -38,7 +38,7 @@ static int init_pass2(MpegEncContext *s);
static
double
get_qscale
(
MpegEncContext
*
s
,
RateControlEntry
*
rce
,
double
rate_factor
,
int
frame_num
);
void
ff_write_pass1_stats
(
MpegEncContext
*
s
){
s
printf
(
s
->
avctx
->
stats_out
,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d;
\n
"
,
s
nprintf
(
s
->
avctx
->
stats_out
,
256
,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d;
\n
"
,
s
->
current_picture_ptr
->
display_picture_number
,
s
->
current_picture_ptr
->
coded_picture_number
,
s
->
pict_type
,
s
->
current_picture
.
quality
,
s
->
i_tex_bits
,
s
->
p_tex_bits
,
s
->
mv_bits
,
s
->
misc_bits
,
s
->
f_code
,
s
->
b_code
,
s
->
current_picture
.
mc_mb_var_sum
,
s
->
current_picture
.
mb_var_sum
,
s
->
i_count
);
...
...
libavcodec/utils.c
View file @
2fc8ea24
...
...
@@ -762,7 +762,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
strcpy
(
channels_str
,
"5:1"
);
break
;
default
:
s
printf
(
channels_str
,
"%d channels"
,
enc
->
channels
);
s
nprintf
(
channels_str
,
sizeof
(
channels_str
)
,
"%d channels"
,
enc
->
channels
);
break
;
}
if
(
enc
->
sample_rate
)
{
...
...
libavformat/udp.c
View file @
2fc8ea24
...
...
@@ -121,7 +121,7 @@ struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type,
const
char
*
node
=
0
,
*
service
=
0
;
if
(
port
>
0
)
{
s
printf
(
sport
,
"%d"
,
port
);
s
nprintf
(
sport
,
sizeof
(
sport
)
,
"%d"
,
port
);
service
=
sport
;
}
if
((
hostname
)
&&
(
hostname
[
0
]
!=
'\0'
)
&&
(
hostname
[
0
]
!=
'?'
))
{
...
...
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