Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
84be8069
Commit
84be8069
authored
May 12, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu: define FF_MEMORY_POISON and use it
Allow single-place definition of constant used to fill poisoned memory.
parent
e70e2583
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
buffer.c
libavutil/buffer.c
+1
-1
internal.h
libavutil/internal.h
+2
-0
mem.c
libavutil/mem.c
+1
-1
No files found.
libavutil/buffer.c
View file @
84be8069
...
...
@@ -288,7 +288,7 @@ static void pool_release_buffer(void *opaque, uint8_t *data)
AVBufferPool
*
pool
=
buf
->
pool
;
if
(
CONFIG_MEMORY_POISONING
)
memset
(
buf
->
data
,
0x2a
,
pool
->
size
);
memset
(
buf
->
data
,
FF_MEMORY_POISON
,
pool
->
size
);
add_to_pool
(
buf
);
if
(
!
avpriv_atomic_int_add_and_fetch
(
&
pool
->
refcount
,
-
1
))
...
...
libavutil/internal.h
View file @
84be8069
...
...
@@ -66,6 +66,8 @@
# define INT_BIT (CHAR_BIT * sizeof(int))
#endif
#define FF_MEMORY_POISON 0x2a
// Some broken preprocessors need a second expansion
// to be forced to tokenize __VA_ARGS__
#define E1(x) x
...
...
libavutil/mem.c
View file @
84be8069
...
...
@@ -133,7 +133,7 @@ void *av_malloc(size_t size)
}
#if CONFIG_MEMORY_POISONING
if
(
ptr
)
memset
(
ptr
,
0x2a
,
size
);
memset
(
ptr
,
FF_MEMORY_POISON
,
size
);
#endif
return
ptr
;
}
...
...
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