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
ab294069
Commit
ab294069
authored
Oct 15, 2011
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: Check for invalid buffer length.
parent
5a9ee315
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
aviobuf.c
libavformat/aviobuf.c
+5
-2
No files found.
libavformat/aviobuf.c
View file @
ab294069
...
...
@@ -769,13 +769,14 @@ int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
{
int
i
;
if
(
buflen
<=
0
)
return
AVERROR
(
EINVAL
);
// reserve 1 byte for terminating 0
buflen
=
FFMIN
(
buflen
-
1
,
maxlen
);
for
(
i
=
0
;
i
<
buflen
;
i
++
)
if
(
!
(
buf
[
i
]
=
avio_r8
(
s
)))
return
i
+
1
;
if
(
buflen
)
buf
[
i
]
=
0
;
buf
[
i
]
=
0
;
for
(;
i
<
maxlen
;
i
++
)
if
(
!
avio_r8
(
s
))
return
i
+
1
;
...
...
@@ -787,6 +788,8 @@ int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
{\
char* q = buf;\
int ret = 0;\
if (buflen <= 0) \
return AVERROR(EINVAL); \
while (ret + 1 < maxlen) {\
uint8_t tmp;\
uint32_t ch;\
...
...
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