Browse code

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

Anton Khirnov authored on 2012/05/06 14:14:01
Showing 1 changed files
... ...
@@ -137,7 +137,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
137 137
 static av_cold void uninit(AVFilterContext *ctx)
138 138
 {
139 139
     BufferSourceContext *s = ctx->priv;
140
-    while (av_fifo_size(s->fifo)) {
140
+    while (s->fifo && av_fifo_size(s->fifo)) {
141 141
         AVFilterBufferRef *buf;
142 142
         av_fifo_generic_read(s->fifo, &buf, sizeof(buf), NULL);
143 143
         avfilter_unref_buffer(buf);