From cf09496cf996d21cc718eb0ac0bdf5f0e96d581e Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 22 Apr 2012 20:07:04 +0200
Subject: [PATCH] ffmpeg: assert against creation of cycles in the pools linked
 list.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 ffmpeg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index dc318d134f3..567edd3eb77 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -599,6 +599,9 @@ static void unref_buffer(InputStream *ist, FrameBuffer *buf)
     av_assert0(buf->refcount > 0);
     buf->refcount--;
     if (!buf->refcount) {
+        FrameBuffer *tmp;
+        for(tmp= ist->buffer_pool; tmp; tmp= tmp->next)
+            av_assert1(tmp != buf);
         buf->next = ist->buffer_pool;
         ist->buffer_pool = buf;
     }
-- 
GitLab