vsrc_buffer: fix null ptr segfault
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 01:19:57 +0000 (03:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 02:06:06 +0000 (04:06 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vsrc_buffer.c

index d003add..ba00b2b 100644 (file)
@@ -209,7 +209,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     BufferSourceContext *s = ctx->priv;
-    while (av_fifo_size(s->fifo)) {
+    while (s->fifo && av_fifo_size(s->fifo)) {
         AVFilterBufferRef *buf;
         av_fifo_generic_read(s->fifo, &buf, sizeof(buf), NULL);
         avfilter_unref_buffer(buf);