sink_buffer: guard against NULL frames.
authorNicolas George <nicolas.george@normalesup.org>
Tue, 24 Apr 2012 10:51:37 +0000 (12:51 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Thu, 31 May 2012 15:27:27 +0000 (17:27 +0200)
This only happens if some filter somewhere is bogus,
but it helps debugging.

libavfilter/sink_buffer.c

index 3eb66ca..d83f21b 100644 (file)
@@ -23,6 +23,7 @@
  * buffer video sink
  */
 
+#include "libavutil/avassert.h"
 #include "libavutil/fifo.h"
 #include "avfilter.h"
 #include "buffersink.h"
@@ -98,6 +99,7 @@ static void end_frame(AVFilterLink *inlink)
     AVFilterContext *ctx = inlink->dst;
     BufferSinkContext *buf = inlink->dst->priv;
 
+    av_assert1(inlink->cur_buf);
     if (av_fifo_space(buf->fifo) < sizeof(AVFilterBufferRef *)) {
         /* realloc fifo size */
         if (av_fifo_realloc2(buf->fifo, av_fifo_size(buf->fifo) * 2) < 0) {