Allow single-place definition of constant used to fill poisoned memory.
Unified · Split
| @@ -288,7 +288,7 @@ static void pool_release_buffer(void *opaque, uint8_t *data) · 287 unmodified lines | |||
| 288 | AVBufferPool *pool = buf->pool; | 288 | AVBufferPool *pool = buf->pool; |
| 289 | 289 | ||
| 290 | if(CONFIG_MEMORY_POISONING) | 290 | if(CONFIG_MEMORY_POISONING) |
| 291 | memset(buf->data, 0x2a, pool->size); | 291 | memset(buf->data, FF_MEMORY_POISON, pool->size); |
| 292 | 292 | ||
| 293 | add_to_pool(buf); | 293 | add_to_pool(buf); |
| 294 | if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1)) | 294 | if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1)) |
| @@ -66,6 +66,8 @@ · 65 unmodified lines | |||
| 66 | # define INT_BIT (CHAR_BIT * sizeof(int)) | 66 | # define INT_BIT (CHAR_BIT * sizeof(int)) |
| 67 | #endif | 67 | #endif |
| 68 | 68 | ||
| 69 | #define FF_MEMORY_POISON 0x2a | ||
| 70 | |||
| 69 | // Some broken preprocessors need a second expansion | 71 | // Some broken preprocessors need a second expansion |
| 70 | // to be forced to tokenize __VA_ARGS__ | 72 | // to be forced to tokenize __VA_ARGS__ |
| 71 | #define E1(x) x | 73 | #define E1(x) x |
| @@ -133,7 +133,7 @@ void *av_malloc(size_t size) · 132 unmodified lines | |||
| 133 | } | 133 | } |
| 134 | #if CONFIG_MEMORY_POISONING | 134 | #if CONFIG_MEMORY_POISONING |
| 135 | if (ptr) | 135 | if (ptr) |
| 136 | memset(ptr, 0x2a, size); | 136 | memset(ptr, FF_MEMORY_POISON, size); |
| 137 | #endif | 137 | #endif |
| 138 | return ptr; | 138 | return ptr; |
| 139 | } | 139 | } |