[libav-commits] buffersrc: fix invalid read in uninit if the fifo hasn't been allocated

Anton Khirnov git at libav.org
Mon May 14 21:38:39 CEST 2012


Module: libav
Branch: master
Commit: 8b05e13df3b25e186adaf19cf84f5fa93d829214

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Sun May  6 07:14:01 2012 +0200

buffersrc: fix invalid read in uninit if the fifo hasn't been allocated

---

 libavfilter/buffersrc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 1ace368..c7284c1 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -137,7 +137,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);



More information about the libav-commits mailing list