mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-18 21:45:10 +00:00
avfilter: add some asserts() to check refcounts.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
72b33eade1
commit
c6baa4046a
@ -92,6 +92,7 @@ static void free_pool(AVFilterPool *pool)
|
|||||||
AVFilterBufferRef *picref = pool->pic[i];
|
AVFilterBufferRef *picref = pool->pic[i];
|
||||||
/* free buffer: picrefs stored in the pool are not
|
/* free buffer: picrefs stored in the pool are not
|
||||||
* supposed to contain a free callback */
|
* supposed to contain a free callback */
|
||||||
|
av_assert0(!picref->buf->refcount);
|
||||||
av_freep(&picref->buf->data[0]);
|
av_freep(&picref->buf->data[0]);
|
||||||
av_freep(&picref->buf);
|
av_freep(&picref->buf);
|
||||||
|
|
||||||
@ -146,6 +147,7 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref)
|
|||||||
{
|
{
|
||||||
if (!ref)
|
if (!ref)
|
||||||
return;
|
return;
|
||||||
|
av_assert0(ref->buf->refcount > 0);
|
||||||
if (!(--ref->buf->refcount)) {
|
if (!(--ref->buf->refcount)) {
|
||||||
if (!ref->buf->free) {
|
if (!ref->buf->free) {
|
||||||
store_in_pool(ref);
|
store_in_pool(ref);
|
||||||
|
Loading…
Reference in New Issue
Block a user