diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-07-02 19:31:35 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-07-02 21:02:15 +0200 |
commit | 7c84e7d33762a4bccc0002476a3b20e0b8f26fcc (patch) | |
tree | 30163a541ec3307e174568460f8b7fb66de4a52c /libavutil | |
parent | 2278a3e5f7327fb2ba823fb10275b5a726adee6f (diff) | |
download | ffmpeg-7c84e7d33762a4bccc0002476a3b20e0b8f26fcc.tar.gz |
mem: heap memory poisoning.
Enable it by default with FATE.
limitation: not random, and not supported with realloc.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/mem.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c index 385ace0702..8ec226b17a 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -125,8 +125,14 @@ void *av_malloc(size_t size) #else ptr = malloc(size); #endif - if(!ptr && !size) + if(!ptr && !size) { + size = 1; ptr= av_malloc(1); + } +#if CONFIG_MEMORY_POISONING + if (ptr) + memset(ptr, 0x2a, size); +#endif return ptr; } |