diff options
Diffstat (limited to 'ffmpeg/libavutil/buffer.c')
| -rw-r--r-- | ffmpeg/libavutil/buffer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ffmpeg/libavutil/buffer.c b/ffmpeg/libavutil/buffer.c index fc389a5..e9bf54b 100644 --- a/ffmpeg/libavutil/buffer.c +++ b/ffmpeg/libavutil/buffer.c @@ -125,6 +125,16 @@ int av_buffer_is_writable(const AVBufferRef *buf) return avpriv_atomic_int_get(&buf->buffer->refcount) == 1; } +void *av_buffer_get_opaque(const AVBufferRef *buf) +{ + return buf->buffer->opaque; +} + +int av_buffer_get_ref_count(const AVBufferRef *buf) +{ + return buf->buffer->refcount; +} + int av_buffer_make_writable(AVBufferRef **pbuf) { AVBufferRef *newbuf, *buf = *pbuf; @@ -276,6 +286,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, FF_MEMORY_POISON, pool->size); + add_to_pool(buf); if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1)) buffer_pool_free(pool); |
