History

lavu: define FF_MEMORY_POISON and use it

Allow single-place definition of constant used to fill poisoned memory.

Stefano Sabatini committed 13 years ago

Commit 84be8061 parent e70e2583 files · +4 −2Browse files

Unified · Split

3 files
  1. libavutil/buffer.c +1 −1
  2. libavutil/internal.h +2 −0
  3. libavutil/mem.c +1 −1
libavutil/buffer.c+1−1
@@ -288,7 +288,7 @@ static void pool_release_buffer(void *opaque, uint8_t *data) · 287 unmodified lines
288288 AVBufferPool *pool = buf->pool;
289289
290290 if(CONFIG_MEMORY_POISONING)
291− memset(buf->data, 0x2a, pool->size);
291+ memset(buf->data, FF_MEMORY_POISON, pool->size);
292292
293293 add_to_pool(buf);
294294 if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1))
libavutil/internal.h+2−0
@@ -66,6 +66,8 @@ · 65 unmodified lines
6666 # define INT_BIT (CHAR_BIT * sizeof(int))
6767 #endif
6868
69+#define FF_MEMORY_POISON 0x2a
70+
6971 // Some broken preprocessors need a second expansion
7072 // to be forced to tokenize __VA_ARGS__
7173 #define E1(x) x
libavutil/mem.c+1−1
@@ -133,7 +133,7 @@ void *av_malloc(size_t size) · 132 unmodified lines
133133 }
134134 #if CONFIG_MEMORY_POISONING
135135 if (ptr)
136− memset(ptr, 0x2a, size);
136+ memset(ptr, FF_MEMORY_POISON, size);
137137 #endif
138138 return ptr;
139139 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t