vf_fps: fix a memleak on malloc failure.
authorAnton Khirnov <anton@khirnov.net>
Sun, 15 Jul 2012 07:50:49 +0000 (09:50 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 22 Jul 2012 07:14:05 +0000 (09:14 +0200)
libavfilter/vf_fps.c

index ab7cba5..bf140f8 100644 (file)
@@ -161,8 +161,10 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFilterBufferRef *buf)
     int ret;
 
     if (!av_fifo_space(fifo) &&
-        (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo))))
+        (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo)))) {
+        avfilter_unref_bufferp(&buf);
         return ret;
+    }
 
     av_fifo_generic_write(fifo, &buf, sizeof(buf), NULL);
     return 0;