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
140a9afc
Commit
140a9afc
authored
Jan 17, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffprobe: add more safe casts in value_string()
Second attempt at fixing ticket #921.
parent
2c8d37c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ffprobe.c
ffprobe.c
+3
-3
No files found.
ffprobe.c
View file @
140a9afc
...
@@ -119,15 +119,15 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
...
@@ -119,15 +119,15 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
prefix_string
=
decimal_unit_prefixes
[
index
];
prefix_string
=
decimal_unit_prefixes
[
index
];
}
}
if
(
show_float
||
vald
!=
(
int
)
vald
)
l
=
snprintf
(
buf
,
buf_size
,
"%.3f"
,
vald
);
if
(
show_float
||
vald
!=
(
long
long
int
)
vald
)
l
=
snprintf
(
buf
,
buf_size
,
"%.3f"
,
vald
);
else
l
=
snprintf
(
buf
,
buf_size
,
"%lld"
,
(
long
long
int
)
vald
);
else
l
=
snprintf
(
buf
,
buf_size
,
"%lld"
,
(
long
long
int
)
vald
);
snprintf
(
buf
+
l
,
buf_size
-
l
,
"%s%s%s"
,
prefix_string
||
show_value_unit
?
" "
:
""
,
snprintf
(
buf
+
l
,
buf_size
-
l
,
"%s%s%s"
,
prefix_string
||
show_value_unit
?
" "
:
""
,
prefix_string
,
show_value_unit
?
uv
.
unit
:
""
);
prefix_string
,
show_value_unit
?
uv
.
unit
:
""
);
}
else
{
}
else
{
int
l
;
int
l
;
if
(
show_float
)
l
=
snprintf
(
buf
,
buf_size
,
"%.3f"
,
vald
);
if
(
show_float
)
l
=
snprintf
(
buf
,
buf_size
,
"%.3f"
,
vald
);
else
l
=
snprintf
(
buf
,
buf_size
,
"%
d"
,
(
int
)
vald
);
else
l
=
snprintf
(
buf
,
buf_size
,
"%
lld"
,
(
long
long
int
)
vald
);
snprintf
(
buf
+
l
,
buf_size
-
l
,
"%s%s"
,
show_value_unit
?
" "
:
""
,
snprintf
(
buf
+
l
,
buf_size
-
l
,
"%s%s"
,
show_value_unit
?
" "
:
""
,
show_value_unit
?
uv
.
unit
:
""
);
show_value_unit
?
uv
.
unit
:
""
);
}
}
...
...
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