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
0e003d8c
Commit
0e003d8c
authored
Jul 10, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add av_fast_padded_mallocz
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
ca16f88c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
APIchanges
doc/APIchanges
+3
-0
avcodec.h
libavcodec/avcodec.h
+6
-0
utils.c
libavcodec/utils.c
+12
-0
No files found.
doc/APIchanges
View file @
0e003d8c
...
...
@@ -15,6 +15,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2012-07-10 - xxxxxxx - lavc 54.33.100
Add av_fast_padded_mallocz().
2012-07-10 - xxxxxxx - lavfi 3.2.0 - avfilter.h
Add init_opaque() callback to AVFilter struct.
...
...
libavcodec/avcodec.h
View file @
0e003d8c
...
...
@@ -4601,6 +4601,12 @@ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
*/
void
av_fast_padded_malloc
(
void
*
ptr
,
unsigned
int
*
size
,
size_t
min_size
);
/**
* Same behaviour av_fast_padded_malloc except that buffer will always
* be 0-initialized after call.
*/
void
av_fast_padded_mallocz
(
void
*
ptr
,
unsigned
int
*
size
,
size_t
min_size
);
/**
* Encode extradata length to a buffer. Used by xiph codecs.
*
...
...
libavcodec/utils.c
View file @
0e003d8c
...
...
@@ -100,6 +100,18 @@ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
memset
(
*
p
+
min_size
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
}
void
av_fast_padded_mallocz
(
void
*
ptr
,
unsigned
int
*
size
,
size_t
min_size
)
{
uint8_t
**
p
=
ptr
;
if
(
min_size
>
SIZE_MAX
-
FF_INPUT_BUFFER_PADDING_SIZE
)
{
av_freep
(
p
);
*
size
=
0
;
return
;
}
if
(
!
ff_fast_malloc
(
p
,
size
,
min_size
+
FF_INPUT_BUFFER_PADDING_SIZE
,
1
))
memset
(
*
p
,
0
,
min_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
}
/* encoder management */
static
AVCodec
*
first_avcodec
=
NULL
;
...
...
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