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
058c0029
Commit
058c0029
authored
Mar 24, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/buffer: support memory poisoning
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d6f96108
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
buffer.c
libavutil/buffer.c
+7
-0
No files found.
libavutil/buffer.c
View file @
058c0029
...
...
@@ -71,6 +71,9 @@ AVBufferRef *av_buffer_alloc(int size)
if
(
!
data
)
return
NULL
;
if
(
CONFIG_MEMORY_POISONING
)
memset
(
data
,
0x2a
,
size
);
ret
=
av_buffer_create
(
data
,
size
,
av_buffer_default_free
,
NULL
,
0
);
if
(
!
ret
)
av_freep
(
&
data
);
...
...
@@ -276,6 +279,10 @@ static void pool_release_buffer(void *opaque, uint8_t *data)
{
BufferPoolEntry
*
buf
=
opaque
;
AVBufferPool
*
pool
=
buf
->
pool
;
if
(
CONFIG_MEMORY_POISONING
)
memset
(
buf
->
data
,
0x2a
,
pool
->
size
);
add_to_pool
(
buf
);
if
(
!
avpriv_atomic_int_add_and_fetch
(
&
pool
->
refcount
,
-
1
))
buffer_pool_free
(
pool
);
...
...
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