summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-22 19:30:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-22 19:30:40 +0100
commitc6baa4046ac48d1cc39a9c8e1c037d3679f64e1e (patch)
treec79b13d7fa6ab6bd0b6b26843dabfe484c8426f3 /libavfilter
parent72b33eade1dbe599e261ca6a819a7ce9f6c2c165 (diff)
avfilter: add some asserts() to check refcounts.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfilter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 6e958e7141..706f7e2694 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -92,6 +92,7 @@ static void free_pool(AVFilterPool *pool)
AVFilterBufferRef *picref = pool->pic[i];
/* free buffer: picrefs stored in the pool are not
* supposed to contain a free callback */
+ av_assert0(!picref->buf->refcount);
av_freep(&picref->buf->data[0]);
av_freep(&picref->buf);
@@ -146,6 +147,7 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
if (!ref)
return;
+ av_assert0(ref->buf->refcount > 0);
if (!(--ref->buf->refcount)) {
if (!ref->buf->free) {
store_in_pool(ref);