sink_buffer: guard against NULL frames.

This only happens if some filter somewhere is bogus,
but it helps debugging.
This commit is contained in:
Nicolas George 2012-04-24 12:51:37 +02:00
parent e03ddbcd91
commit 72f3786d0f

View 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) {