[FFmpeg-cvslog] sink_buffer: guard against NULL frames.

Nicolas George git at videolan.org
Thu May 31 17:39:55 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Tue Apr 24 12:51:37 2012 +0200| [72f3786d0f0897ed0fc3356f4fec167219de54a4] | committer: Nicolas George

sink_buffer: guard against NULL frames.

This only happens if some filter somewhere is bogus,
but it helps debugging.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=72f3786d0f0897ed0fc3356f4fec167219de54a4
---

 libavfilter/sink_buffer.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c
index 3eb66ca..d83f21b 100644
--- a/libavfilter/sink_buffer.c
+++ b/libavfilter/sink_buffer.c
@@ -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) {



More information about the ffmpeg-cvslog mailing list