Browse Source

sink_buffer: guard against NULL frames.

This only happens if some filter somewhere is bogus,
but it helps debugging.
tags/n1.0
Nicolas George 14 years ago
parent
commit
72f3786d0f
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavfilter/sink_buffer.c

+ 2
- 0
libavfilter/sink_buffer.c 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) {


Loading…
Cancel
Save