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
ba064ebe
Commit
ba064ebe
authored
Dec 22, 2012
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oggdec: check memory allocation
parent
f5f1cf52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
oggdec.c
libavformat/oggdec.c
+9
-2
No files found.
libavformat/oggdec.c
View file @
ba064ebe
...
...
@@ -160,8 +160,13 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
AVStream
*
st
;
struct
ogg_stream
*
os
;
ogg
->
streams
=
av_realloc
(
ogg
->
streams
,
ogg
->
nstreams
*
sizeof
(
*
ogg
->
streams
));
os
=
av_realloc
(
ogg
->
streams
,
ogg
->
nstreams
*
sizeof
(
*
ogg
->
streams
));
if
(
!
os
)
return
AVERROR
(
ENOMEM
);
ogg
->
streams
=
os
;
memset
(
ogg
->
streams
+
idx
,
0
,
sizeof
(
*
ogg
->
streams
));
os
=
ogg
->
streams
+
idx
;
...
...
@@ -305,6 +310,8 @@ static int ogg_read_page(AVFormatContext *s, int *str)
if
(
os
->
bufsize
-
os
->
bufpos
<
size
)
{
uint8_t
*
nb
=
av_malloc
((
os
->
bufsize
*=
2
)
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
!
nb
)
return
AVERROR
(
ENOMEM
);
memcpy
(
nb
,
os
->
buf
,
os
->
bufpos
);
av_free
(
os
->
buf
);
os
->
buf
=
nb
;
...
...
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