[FFmpeg-devel] [PATCH 1/3] sink_buffer: guard against NULL frames.
Nicolas George
nicolas.george at normalesup.org
Fri Apr 27 17:38:40 CEST 2012
This only happens if some filter somewhere is bogus,
but it helps debugging.
Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
libavfilter/sink_buffer.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c
index b0cc519..a86de79 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"
@@ -101,6 +102,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) {
--
1.7.2.5
More information about the ffmpeg-devel
mailing list